A question that many developers ask them selves “RavenDB, Why should we care?”. RavenDB is a scheme-less, transactional document database that uses JSON format to store data into documents.
A bit of history.
RavenDB is not a new invention, instead, schema-less database’s have been around since the 1960’s and the first NoSQL database called “MultiValue”. In 1998, Carlo Strozzi developed a file-based database which is a relational database but without SQL interface. NoSQL term came to life in 2009 by Eric Evans who used the term to relate to non-relational databases.
Between 2000 and 2010 many NoSQL databases came to surface:
- db4o – which is an object database for C# and JAVA MemcachedDB
- CouchDB – It provides document database inspired by Lotus Notes.
- BigTable – which is google NoSQL database built on top of Google File System (GFS)
Before diving into RavenDB, let me explain the term NoSQL
NoSQL is a non-relational database that has great beneficial in terms of data retrieval, cheap, flexible data model and can handle big data.
Five advantages of NoSQL that you should know about:
- Scalability – Even with increasingly the amount of data, the system will not reduce its overall performance and availability.
- Big Data Handling – NoSQL can handle “big data” that outstrip what RDBMS can handle
- Needless Management – NoSQL databases are designed from bottom up, which means less management required as data are pretty simple to maintain and tune without the need of DBA
- NoSQL is cheaper – RDBMS relies on expensive servers and storage systems, whereas NoSQL automatically distribute’s data across servers without requiring applications to participate.
- Flexibility – As mentioned previously, NoSQL is schema-less which means we are not restricted to specific schema when we store a new document.
So Why RavenDB?
RavenDB is an open source document database developed by Hibernating Rhinos for .NET platforms, which provides a performance boost to your application, increase development speed and easily maintained application. RavenDB allow developers to start developing in less time comparing to other NoSQL database i.e. CounchDB which requires Erlang to be complied from the source, While on RavenDB, all you need is to download it as a Nuget package, and run RavenDB server instance and that’s all to get you up and running. RavenDB is transactional (ACID) which means data is processed reliably. Another interesting point to mention is that, RavenDB is based on REST, which allow you to operate through url calls.
So, what does RavenDB means for the following?
As a User:
Applications which provides search facility to their users, will allow faster search results, even with data marked as stale (in RavenDB, you have the ability to either ignore there data or wait till they becomes non-stale). RavenDB makes use of Lucene.NET to store indexed data (only indexes are stored not documents) which provides high performance search ability to the application. Also part of Lucene.NET, RavenDB makes use of suggestions, for example, if user searches for a colour, i.e. black, and they typed ‘blac’ the suggestion will return “Do you mean black?”. This feature improves user experience by helping the user to search for the right term.
As a Business
With capabilities provided by RavenDB such as high performance search results and suggestions, users will experience fast application that respond to their queries or submissions. This will attract more users to use the application compared to other data storage mechanism. Change of requirements won’t be bad, as documents are easily changed and modified. RavenDB adds a boost to application development and that by providing an easy to use API and a UI Studio which allow developers to view documents, run queries and check indexes. The costs of RavenDB is much cheaper then having SQL SERVER running in your production environment.
As a Developer
- RavenDB document is based on aggregates – Entities and Value objects are bound together by a root entity (aggregate root). the aggregate root will be the access point.
- ORM (Object Relational Mapping) layer becomes useless as there will be no mismatch between objects and relational data storage.
- RavenDB is more easily scalable then RDBMS – as RDBMS forces data to be manipulated to suite relational databases.
- RavenDB have out-of-box support for replication and sharding.
- Indexes are automatically created if data is requested multiple times
- Ability to add Map/Reduce on top of your document using Linq
- RavenDB supports partial document update which means you don’t have to load the whole document to do an update
- RavenDB implement Unit of Work, tracking, read and write optimization.
- RavenDB have built-in bundles and they are: Versioning, Expiration and Index Replication Bundle
- RavenDB allow you to implement your own bundle
Generally, RavenDB is good technology that will not only impact on the ease of application development for developers but instead it will impact on users experience and businesses.
In the next blog post I’ll discuss and demonstrate the principles/guidelines when it comes to design your RavenDB documents.