weary, Over many a quaint and curious volume of forgotten lore-- While I nodded, nearly napping, suddenly there came a tapping, As of some one gently rapping, rapping at my chamber door. "'Tis some visiter," I muttered, "tapping at my chamber door-- Only this and nothing more."
to all non relational DBs (RDMBS’s) • Big hype • In general: • No relational • No schema • High availability and scalability (Web Scale) • Eventual consistency • No SQL (generally) …just like html5… Villaine hipsters!
friendly • No impedance mismatch (SQL != OOD) • No schema, less friction • Scalability: replication and sharding • Great APIs • Right tool for the job Databases for developers??
ID • If we try to store two entities with the same id -> overwrite • By convention ID = collectionName/entityId (users/1) • By default entity id’s are generated (auto-incremented)
store complex structures • RavenDB is not relational • A document is an independent entity • Include all details you need within the document • This is good for sharding • References are not enforced by the DB • If following DDD, an Aggregrate is a document • This pretty much enforces DDD uses of aggregates from the dB • Use aggregate to enforce invariants to store information safely
transactions, batching, etc • Feels like Entity Framework or NHibernate • IDocumentSession (unit of work) • IDocumentStore (session factory, singleton) • Query with LINQ • Works with pure POCOs • Available on NuGet
{ public string Name {get;set;} } POCO var myCuteRaven= new Raven {Name = “Kiwi”} (Plain Old CLR Object) Document instantiate ravens/1 { “Name”: “Kiwi” }
index • Static indexes persisted in the DB • Dynamic indexes created on the fly • Based on the queries that you do • Self-optimization based on usage • Eventual Consistency • Stale better than offline • BASE (Basically Available, Soft State, Eventual Consistency)
as search engine • Can easily add attachments to documents • Profiling • Fully customizable • cache • Max number of request per session • Key generator • conventions • etc...
• Sharding • Native • Partition contents of a ravendb database across several machines • Replication • Replicate contents of a ravendb database • As a bundle • Can replicate to SQL Server http://ravendb.net/docs/2.5/server/scaling-out