RavenDB 4.1 FeaturesRunning RavenDB embedded

time to read 2 min | 286 words

imageA fun feature we have back in RavenDB is the ability to run RavenDB as part of your own application. Zero deployment, setup or hassle.

The following is the list of steps you will need:

  • Create a new project (.NET Core, .Net Framework, whatever).
  • Grab the pre-release bits from MyGet.
    Install-Package RavenDB.Embedded -Version 4.1.0 -Source https://www.myget.org/F/ravendb/api/v3/index.json
  • Ask the embedded client for a document store, and start working with documents.

And here is the code:

This is it. Your process has a dedicated RavenDB server running which will run alongside your application. When your process is done, RavenDB will shutdown and nothing is running. You don’t need to setup anything, install services or configure permissions.

For extra fun (and reliability), RavenDB is actually running as a separate process. This means that if you are debugging an application that is using an embedded RavenDB, you can stop in the debugger and open the studio, inspecting the current state of the database, running queries, etc.

You have the full capabilities of RavenDB at your disposal. This means being able to use the studio, replicate to other nodes, backup & restore, database encryption, the works. The client API used is the usual one, which means that if you need to switch from running in embedded to server mode, you only need to change your document store initialization and you are done.

We are also working now on bringing this feature to additional platforms. You’ll soon be able to write the following:

This is a Python application that is using RavenDB in embedded mode, and you’ll be able to do so across the board (Java, Node.js, Go, Ruby, etc).

More posts in "RavenDB 4.1 Features" series:

  1. (22 Aug 2018) MongoDB & CosmosDB Migration Wizards
  2. (04 Jul 2018) This document is included in your subscription
  3. (03 Jul 2018) Detailed query timing details
  4. (02 Jul 2018) Of course I know ya, dude
  5. (29 Jun 2018) Running RavenDB embedded
  6. (26 Jun 2018) Can you explain that choice?
  7. (20 Jun 2018) Cluster wide ACID transactions
  8. (19 Jun 2018) Explain that choice
  9. (22 May 2018) Highlighting
  10. (11 May 2018) Counting my counters
  11. (10 May 2018) JavaScript Indexes
  12. (04 May 2018) SQL Migration Wizard