Monday, May 28, 2018

A simple introduction to RavenDB

Let's take a look at a fresh perspective on RavenDB, Linux, containers and .NET Core

I've discussed RavenDB a couple times on this blog. This time let's discuss why you should try it.

About RavenDB

In case you never heard of it, RavenDB is a fast, reliable and extensible NoSql database. Being a NoSql database, it has benefits and drawbacks over Sql databases. Let's review some of the benefits.

If you're interested in more information on why to use a NoSql database, please read this.

RavenDB Benefits

Easy to use

Raven is extremely easy and simple to use, either by developers and non-technical people. In a couple of minutes, non-technical users were able already to interact with the database with no major hiccups.

Easy to install

Installing Raven is easy on most platforms. On Windows and Linux, testing is as simple as downloading the executable, extracting and running the executable.

Raven Studio

Raven Studio is the front-end to interact with RavenDB. It's the app responsible for making the user experience enjoyable for developers and non-developers alike. It’s included with any license, including the free community version.


RavenDB runs on Windows, Linux, macOS, Docker, Raspberry Pi and other platforms.

Multiple Clients

RavenDB client can be accessed using the major programming languages in the market, including C#, Java, Node, Python, Ruby and Go!.


RavenDB is the first non-relational database to achieve ACID across the entire database. Maintain the best of SQL while boosting your capacity to the next level.

Management Options

You can set up a distributed data cluster in minutes. Replicate your database in real time so you can be everywhere at once, and always available to your users.

Simple CRUD

This is especially important to developers. It means easily creating/updating/deleting records, quicker to test and to release, no migration scripts, simple and powerful api. For example, this is how I insert a record in the database:
Example: a very simple insert operation in Raven.

Simple NoSQL Querying

RavenDB has powerful ways to do query including geospacial, faceted, full-text and map-reduce operations. But since most of the time, what you want is very easily available to you via the api and indexes.
Example: a very simple "select * from Category" query in RavenDB.

Index Support

Indexes in RavenDB are one of the strongest points. Being a NoSql database, it's an intelligent solution to avoiding multiple requests to the database by merging multiple tables. We will also revise this in future posts.

In-Memory Database

RavenDB has an in-memory database that you can use to persist data from your application (and replace SqlLite for example) or, better yet, use in your tests so you have real db operations (in-memory) without the hassle of creating mocks and simulating your tests.

Extensions / Bundles

You can extend the database with bundles and extensions. Some come already built in for us, others can be created through what they call Bundles. It's more of a technical solution but very interesting feature to have available.

For example, these are the out of the box bundles that come with a standard RavenDB installation:

Powerful and Extensive Api

Apart from (most of the time) simple operations, we have lots of advanced features in the client api to manage everything from tables (collections), recods, bulk operations to database indexes, etc.

RavenHQ - A RavenDB Cloud

Yes, Raven has a cloud that you can host your databases without any need to manage VMs on your favourite cloud provider. I never used it myself but would like to explore it in the future.

And more, way more!

There's more, way more to explore.  Check the RavenDB features page to learn more about it.

Final Thoughts

In almost 20 years working with software development, I know how difficult it is to manage and evolve databases during the project life cycle. Being agile today requires releasing as fast as possible and complex operations like data migration can have a big impact on your domain. My experience with RavenDB, is that development, patches, migrations and even clustering are greatly simplified.

And because it makes sense to do polyglot persistence, why not use RavenDB, beside your existing Sql instance of a or even side by side with your MongoDB, CouchDB, Redis and Cassandra?

So go ahead, install it on your machine and give it a try!

See Also

Installing and Running RavenDB on Windows and Linux
Running RavenDB on Docker
Querying RavenDB Metadata
Patching RavenDB Metadata

For more RavenDB posts on this blog, please click here.