1. Introducing liveDB
Build faster systems faster
Robert Friberg, robert@devrex.se
Twitter: @robertfriberg, @livedomain, #livedb
http://livedb.devrex.se/
liveDB
2. Prevalent System Architecture
Clients
Client
liveDB
.NET Process Memory Disk
Engine
In-memory
Object
Model
Transaction Log
Synchronized execution Snapshot.0
Pass queries and
commands
Command
serialization
Client
Snapshot.1
Snapshot.N
3. The prevalent hypothesis
Your data will fit in available RAM
99% of all OLTP database are 1TB or less
--Stonebraker, VoltDB
liveDB
4. Eric Schmidt, Google CEO
At Google we found it costs less money and it is more
efficient to use DRAM as storage as opposed to hard
disks.
Three minutes with Google's Eric Schmidt , CNN.COM
liveDB
5. What is liveDB?
A native .NET in-memory database engine
Full ACID support
Embedded engine free to use for any purpose
Supports any data representation
liveDB
6. The NoSQL revolution
RDBMS paradigm is shaking
Alternative data representation, document, graph, key/value, etc
Support large scale databases
LiveDB focuses on
Memory vs. Disk
Freedom of representation
Facebook is not the common case
liveDB
7. Relational Database Prison
Relational model formulated 1969
Designed to address limitations non-existent today – disk access
A relational model is just one of many possible datarepresentations
Primitive stored procedure language
O/R Mapping adds to the pain
liveDB
8. O/R mapping vs Command/Query pattern
O/R mapping is based on CRUD pattern
CRUD is a specialization of Request/response
Command/Query is more general (superset)
You can do CRUD with Command/Query but not the other way around
liveDB
9. Business arguments
Reduced time to market
Lower TCO for software systems
Reduced development time up to 40%
Operations (no rdbms)
Licensing (no rdbms)
Faster systems
liveDB
10. Developer benefits
Model is pure .NET types and collections
representational freedom
DAL and downwards is eliminated
No object/relational mapping
No relational modeling
No T-SQL programming
Debugging
Version control
Supports DDD, TDD
liveDB
12. Start your engines!
var db = Engine.Load<MyModel>(path);
db.Execute(command);
var c = db.Execute(m => m.Customers.GetById(42));
...
var cmd = SetPasswordCommand(c.Id, newPassword);
db.Execute(cmd);
db.Close();
liveDB
13. Demo!
http://roxsux.devrex.se/
Coding a simple model
Commands and queries
Hosting the engine
See blog for more info: http://livedb.devrex.se/
liveDB
14. Drawbacks
Model must fit in RAM
Load time (start up and rollback)
Versioning issues
.NET Only (Json possible)
No magical indexing (yet)
liveDB
15. Gotchas
No external dependencies from commands
Don’t modify the model with query
Rollback is expensive
Don’t manipulate model out of context
Dont rely on reference equality
Results are not direct references
liveDB
16. References
Prevalent System Architecture
prevayler.org, java project from 2003, alive and kicking
Bamboo.Prevalence .NET 1.1, dead project?
VoltDB
liveDB