livedb introduction at devsum 2011

17
liveDB Introducing liveDB Build faster systems faster Robert Friberg, [email protected] Twitter: @robertfriberg, @livedomain, #livedb http://livedb.devrex.se/

Upload: robert-friberg

Post on 13-Jul-2015

48 views

Category:

Software


1 download

TRANSCRIPT

liveDB

Introducing liveDBBuild faster systems faster

Robert Friberg, [email protected]: @robertfriberg, @livedomain, #livedbhttp://livedb.devrex.se/

liveDB

Disk.NET Process Memory

Engine

In-memoryObjectModel

Transaction Log

Synchronized execution Snapshot.0

Pass queries andcommands

Commandserialization

Prevalent System Architecture

ClientClient

Clients

Snapshot.1

Snapshot.N

liveDB

The prevalent hypothesis

Your data will fit in available RAM

99% of all OLTP database are 1TB or less--Stonebraker, VoltDB

liveDB

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

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

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

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

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

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

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

Simple API

liveDB

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

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

Drawbacks

Model must fit in RAM

Load time (start up and rollback)

Versioning issues

.NET Only (Json possible)

No magical indexing (yet)

liveDB

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

References

Prevalent System Architecture

prevayler.org, java project from 2003, alive and kicking

Bamboo.Prevalence .NET 1.1, dead project?

VoltDB

liveDB

Thank you!

Robert Friberg, Devrex

Twitter: @robertfriberg, @livedomain, #livedb

http://livedb.devrex.se/