A sample ASP.NET 5 application using RavenDB
- New Raven Studio! No more Silverlight!!!
- Support for Voron storage engine (port of Lightning Memory-mapped Database)
- More performant
- No DTC transaction support
- Some changes to index performance
WhatChanged
andHasChanges
available on session- Missing properties on save operation are retained in database
- Full details in links at the bottom
- Ease of development
- No difference between data storage model and application model
- Schemaless, so the document structure is created on the fly
- Easier to change document structure in a rapid development workflow
- Can be more efficient if used properly
- Documents usually stored as continguous memory blocks
- Better for distributed database system because better locality can be maintained
-
Domain objects spread across many tables
-
Normalization
-
Lots of foreign key relationships to produce complete picture
// Orders { "Id": "1", "UserId": "1" } // OrderLines { "Id": "1", "ProductId": "1", "Quantity": "10", "Price": "10.00" } // Products { "Id": "1", "Description": "Blah blah blah", "Price": "10:00" }
- Domain objects consolidated into fewer documents
- Denormalization
- Less foreign key relationships
// Orders
{
"Id": "1",
"UserId": "1",
"OrderLines":
[
{
"Id": "1",
"ProductId": "1",
"Quantity": "10",
"Price": "10.00"
}
]
}
// Products
{
"Id": "1",
"Description": "Blah blah blah",
"Price": "10:00"
}
- Focus less on how the data is stored, and more on how it will be accessed
- Ask yourself, will this type ever need to be accessed independently, or does it only make sense within the context of some parent document?
- Queries are always against indexes
- Indexes are built asynronously in the background
- Data can be stale
- Static/Dynamic indexes
- ACID/BASE - http://ravendb.net/docs/article-page/2.5/csharp/client-api/advanced/transaction-support
- This is a simple application to demonstrate basic database creation, session usage, and CRUD operations
- Start with
DocumentStoreLifecycle
to see how to create a database - See the
PeopleController
for basic usage of Raven, including:- Creating
- Editing
- Deleting
- Loading
- Loading multiple docs
- Querying with Linq
- Some advanced querying features
- Paging
- Stale data
- Document design
- More on ACID/BASE nature of Raven
- Server configuration
- New in RavenDB 3