Performance

Achieve 100,000 writes per second, and over one million reads on commodity hardware. We developed Voron, our own custom-made storage engine tailored just to soup up RavenDB’s performance.

Management Studio

Our GUI makes the RavenDB user experience enjoyable for developers and non-developers alike. It’s part of any license, including your free community version.

Fully Transactional

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.

Multi-Model Architecture

Married to your legacy SQL solution? RavenDB works well with relational databases, giving you the opportunity to add a NoSQL layer to your existing architecture without any disruptions.

Multi-Platform

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

High Availability

Break free of the single server bottleneck. 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.

Ease of Use

RavenDB is easy to install, simple to secure, and quick to learn. Our query language is 85% SQL. Using our training resources, you can become an expert in a few days.

Designed with Care

Spend more time coding, and less time on the phone with support. We exposed a lot of internals in approachable way to help you self-solve problems and reduce overhead. When you do need help, our support engineers are the best in the business.

FREE

Your community license includes the Management Studio GUI, 3 cores, a distributed data cluster of 3 nodes, 6GB of RAM, and easy compatibility with cloud services like AWS, Azure, and more.

Clients

Clients

C#

Features

  • A fluent and predictable hand-tailored API
  • Full LINQ to RQL support
  • Safe by default
  • Extensible and configurable with the ability to inject behavior directly from server
  • DDD compatible
  • Unit of Work

Platforms

  • .NET Core 1.0 and up
  • .NET Framework 4.6 and up

Initializing DocumentStore

Documentation

// 'DocumentStore' is a main-entry point for client API.
// It is responsible for managing and establishing connections
// between your application and RavenDB server/cluster
// and is capable of working with multiple databases at once.
// Due to it's nature, it is recommended to have only one
// singleton instance per application
public static class DocumentStoreHolder
{
    private static readonly Lazy<IDocumentStore> LazyStore =
        new Lazy<IDocumentStore>(() =>
        {
            var store = new DocumentStore
            {
                Urls = new[] { "http://localhost:8080" },
                Database = "Northwind"
            };

            return store.Initialize();
        });

    public static IDocumentStore Store => LazyStore.Value;
}

Opening session

Documentation

// 'DocumentSession' or 'Session' is a short-living and lightweight object
// used as a main and recommended interaction point with the database.
// With 'Session' you are able to load documents, modify them, save them back
// issue queries, patches, and much more.
// It implements Unit Of Work concept and is batching requests
// to reduce the expensive network traffic
using (IDocumentSession session = DocumentStoreHolder.Store.OpenSession())
{
    // code here
}

Save multiple entities

Documentation

var category = new Category
{
    Name = "Electronics"
};

// Store the category in 'Session'
// and automatically assign Id using HiLo algorithm
session.Store(category); 

var product = new Product
{
    Name = "Laptop 2000",
    Category = category.Id      // use the previously assigned Id
};

// Store the product in 'Session'
// and automatically assign Id using HiLo algorithm
session.Store(product);

// Synchronize changes with the server.
// All changes will be send in one batch
// that will be processed as _one_ ACID transaction
session.SaveChanges();

Load & Modify

Documentation

// Load the 'Employee' and start tracking its changes
Employee employee = session.Load<Employee>("employees/1-A");

// Apply modifications
employee.FirstName = "Juliette";

// Synchronize changes with the server.
// All changes will be send in one batch
// that will be processed as _one_ ACID transaction
session.SaveChanges();
// return all entities from 'Employees' collection
// where FirstName equals 'Robert'
List<Employee> employees = session
    .Query<Employee>()
    .Where(x => x.FirstName == "Robert")
    .ToList();

// return all 'LastNames' from 'Employees' collection
// that were born after '1960-01-01'
List<string> lastNames = session
    .Query<Employee>()
    .Where(x => x.Birthday > new DateTime(1960, 1, 1))
    .Select(x => x.LastName)
    .ToList();

Java

Features

  • A fluent and predictable hand-tailored API
  • Safe by default
  • Extensible and configurable
  • DDD compatible
  • Unit of Work

JVM Requirements

  • Java 1.8+

Initializing DocumentStore

// 'DocumentStore' is a main-entry point for client API.
// It is responsible for managing and establishing connections
// between your application and RavenDB server/cluster
// and is capable of working with multiple databases at once.
// Due to it's nature, it is recommended to have only one
// singleton instance per application
public class DocumentStoreHolder {

    private static class DocumentStoreContainer {
        public static final IDocumentStore store =
            new DocumentStore("http://localhost:8080", "Northwind");

        static {
            store.initialize();
        }
    }

    public static IDocumentStore getStore() {
        return DocumentStoreContainer.store;
    }
}

Opening session

// 'DocumentSession' or 'Session' is a short-living and lightweight object
// used as a main and recommended interaction point with the database.
// With 'Session' you are able to load documents, modify them, save them back
// issue queries, patches, and much more.
// It implements Unit Of Work concept and is batching requests
// to reduce the expensive network traffic
try (IDocumentSession session = DocumentStoreHolder.getStore().openSession()) {
{
    // code here
}

Save multiple entities

Category category = new Category();
category.setName("Electronics");

// Store the category in 'Session'
// and automatically assign Id using HiLo algorithm
session.store(category);

Product product = new Product();
product.setName("Laptop 2000");
product.setCategory(category.getId()); // use the previously assigned Id

// Store the product in 'Session'
// and automatically assign Id using HiLo algorithm
session.store(product);

// Synchronize changes with the server.
// All changes will be send in one batch
// that will be processed as _one_ ACID transaction
session.saveChanges();

Load & Modify

// Load the 'Employee' and start tracking its changes
Employee employee = session.load(Employee.class, "employees/1-A");

// Apply modifications
employee.setFirstName("Juliette");

// Synchronize changes with the server.
// All changes will be send in one batch
// that will be processed as _one_ ACID transaction
session.saveChanges();

Query

// return all entities from 'Employees' collection
// where firstName equals 'Robert'
List<Employee> employees = session.query(Employee.class)
                .whereEquals("firstName", "Robert")
                .toList();

// return all 'lastNames' from 'Employees' collection
// that are over 18
List<String> lastNames = session.query(Employee.class)
                .whereGreaterThanOrEqual("age", 18)
                .selectFields(String.class, "lastName")
                .toList();

Node.js

Python

Ruby

Go

Querying

Querying Available in all versions

Raven Query Language

Query with a familiar and straight-forward language.

Our RQL (Raven Query Language) allows you to execute all available types of queries and is a part of our JavaScript patching API. Based on SQL, it can be easily assimilated with few additions of our own.

RQL

from Orders                                             // select
where Lines.Count > 4                                   // filter
select Lines[].ProductName as ProductNames,             // project
OrderedAt, ShipTo.City                                  

RQL

from Orders as o                                        // select
load o.Company as c                                     // load related data
select {                                                // project using JavaScript
    Name: c.Name.toLowerCase(),                         
    Country: c.Address.Country,
    LinesCount: o.Lines.length
}

RQL

from Orders                                             // select
group by Company                                        // group
where count() > 5                                       // filter
order by count() desc                                   // order
select count() as Count, key() as Company               // project
include Company                                         // side-load related data

Read More

  • You can read more about RQL here.
Querying Available in all versions

Full-Text Search

Perform advanced full-text search operations over one or more fields at once with the ability to supply your own custom analyzer.

// return all of the companies
// which one of the words in 'Name' is 'store'
from Companies
where search(Name, 'store')
// return all of the companies
// which one of the words in 'Name' is 'store'
var companies = session
    .Query<Company>
    .Search(x => x.Name, "store")
    .ToList();
// return all of the companies
// which one of the words in 'name' is 'store'
List<Company> companies = session
                .query(Company.class)
                .search("name", "store")
                .toList();

Read More

  • You can read more about searching here.
Querying Available in all versions

Facets

Perform calculations such as counts, sums, averages, min and max on aggregated data and split it into defined ranges without a fuss.

In order to execute faceted search a static index is required. It can be as simple as follows:

C#

private class Cameras_ByManufacturerModelCostDateOfListingAndMegapixels :
    AbstractIndexCreationTask<Camera>
{
    public Cameras_ByManufacturerModelCostDateOfListingAndMegapixels()
    {
        Map = cameras => from camera in cameras
            select new
            {
                camera.Manufacturer,
                camera.Model,
                camera.Cost,
                camera.DateOfListing,
                camera.Megapixels
            };
    }
}

Those are all the requirements for faceted search.
Now queries can be executed against all index fields as follows:

// return 3 facet results for cameras 
// using 'Cameras/ByManufacturerModelCostDateOfListingAndMegapixels' index
// - first result will return aggregations (Count) based on 'Manufacturer'
// - second result will return aggregations (Count, Sum) based on 'Cost' 
//   and divided into supplied 'Cost' ranges
// - third result will return aggregations (Count, Min, Max, Average) based on 'Cost'
//   and divided into supplied 'Megapixels' ranges
from index 'Cameras/ByManufacturerModelCostDateOfListingAndMegapixels' 
where Cost between 100 and 300
select 	facet(Manufacturer), 
		facet(Cost < 200, Cost >= 200 and Cost < 400, Cost >= 400 and Cost < 600, Cost >= 600 and Cost < 800, Cost >= 800, sum(Cost)), 
		facet(Megapixels < 3, Megapixels >= 3 and Megapixels < 7, Megapixels >= 7 and Megapixels < 10, Megapixels >= 10, min(Cost), max(Cost), average(Cost))
// return 3 facet results for cameras 
// using 'Cameras/ByManufacturerModelCostDateOfListingAndMegapixels' index
// - first result will return aggregations (Count) based on 'Manufacturer'
// - second result will return aggregations (Count, Sum) based on 'Cost' 
//   and divided into supplied 'Cost' ranges
// - third result will return aggregations (Count, Min, Max, Average) based on 'Cost'
//   and divided into supplied 'Megapixels' ranges
Dictionary<string, FacetResult> facetResults = session
    .Query<Camera, Cameras_ByManufacturerModelCostDateOfListingAndMegapixels>()
    .Where(x => x.Cost >= 100 && x.Cost <= 300)
    .AggregateBy(builder => builder.ByField(x => x.Manufacturer))
    .AndAggregateBy(builder => builder
        .ByRanges(
            camera => camera.Cost < 200m,
            camera => camera.Cost >= 200m && camera.Cost < 400m,
            camera => camera.Cost >= 400m && camera.Cost < 600m,
            camera => camera.Cost >= 600m && camera.Cost < 800m,
            camera => camera.Cost >= 800m)
        .SumOn(x => x.Cost))
    .AndAggregateBy(builder => builder
        .ByRanges(
            camera => camera.Megapixels < 3.0,
            camera => camera.Megapixels >= 3.0 && camera.Megapixels < 7.0,
            camera => camera.Megapixels >= 7.0 && camera.Megapixels < 10.0,
            camera => camera.Megapixels >= 10.0)
        .MinOn(x => x.Cost)
        .MaxOn(x => x.Cost)
        .AverageOn(x => x.Cost))
    .Execute();

Read More

  • You can read more about faceted search here.
Querying Available in all versions

MoreLikeThis

Finding similar documents has never been easier! Use our built-in MoreLikeThis feature to retrieve them.

Let's start by defining an index, where we will index contents of the articles (ArticleBody) using 'StandardAnalyzer' from Lucene and storing the results inside the Lucene index.

C#

public class Articles_ByArticleBody : AbstractIndexCreationTask<Article>
{
    public Articles_ByArticleBody()
    {
        Map = docs => from doc in docs
                      select new
                      {
                          doc.ArticleBody
                      };

        Stores.Add(x => x.ArticleBody, FieldStorage.Yes);
        Analyzers.Add(x => x.ArticleBody, "StandardAnalyzer");
    }
}

At this point everything needed to use MoreLikeThis is done and we can search for our similar articles:

// return all articles
// similar to 'articles/1'
// using 'Articles/ByArticleBody' index
from index 'Articles/ByArticleBody' 
where morelikethis(id() = 'articles/1')
// return all articles
// similar to 'articles/1'
// using 'Articles/ByArticleBody' index
List<Article> articles = session
    .Query<Article, Articles_ByArticleBody>()
    .MoreLikeThis(builder => builder
        .UsingDocument(x => x.Id == "articles/1"))
    .ToList();

Read More

  • You can read more about MoreLikeThis here.
Querying Available in all versions

Spatial

Spatial field can be created from Coordinates (latitude and longitude), or directly from WKT shape using following strategies:

  • with BoundingBox or QuadPrefixTree
  • Geographical with BoundingBox, GeohashPrefixTree (default) or QuadPrefixTree

RQL itself and our Client API contain built-in methods to help you find the documents with the search areas that can be defined using:

  • within (and within radius)
  • contains
  • disjoin
  • intersect
  • custom relation to WKT shape
// return all the companies 
// within radius of 300km 
// from 45 latitude and 4 longitude coordinate
from Companies
where spatial.within(
    spatial.point(Address.Location.Latitude, Address.Location.Longitude), 
    spatial.circle(300, 45, 4))
// return all the companies 
// within radius of 300km 
// from 45 latitude and 4 longitude coordinate
List<Company> companies = session
    .Query<Company>()
    .Spatial(
        factory => factory
            .Point(    
                x => x.Address.Location.Latitude,
                x => x.Address.Location.Longitude),
        criteria => criteria.WithinRadius(300, 45, 4))
    .ToList();
// return all the companies 
// within radius of 300km 
// from 45 latitude and 4 longitude coordinate
List<Company> companies = session
                .query(Company.class)
                .spatial(
                        new PointField("address.location.latitude", "address.location.longitude"),
                        factory -> factory.withinRadius(300, 45, 4))
                .toList();

Read More

  • You can red more about spatial queries here.
Querying Available in all versions

Patching

Update documents directly on the server-side using our integrated JavaScript-based patching API, a part of RQL syntax.

Filter-out an array item

from Orders 
update { 
    this.Lines = this.Lines.filter(l => l.Product != 'products/1-A');
}

Denormalize the company name

from Orders as o
load o.Company as c
update { 
    o.CompanyName = c.Name;
}

Use the JavaScript to patch

from index 'Orders/Totals' as i
where i.Total > 10000
load i.Company as c
update { 
    i.LowerName = c.Name.toLowerCase();
}

Read More

  • You can read more about Single-Document patching here.
  • If you are interested in Set-Based patching then please reffer to this article.

Indexes

Indexes Available in all versions

Intelligent Auto Indexes

Focus on doing queries, while RavenDB creates the indexes for you.

Auto Indexes are designed when there is no need to customize the capabilities extensively.

With Auto Indexes you will be able to perform queries, including advanced ones like full-text search.

RavenDB supports following auto index types:

  • Auto Map indexes
  • Auto Map-Reduce indexes

RavenDB learns the behavior of your application to merge auto indexes to reduce your overhead. It will schedule unused auto indexes for deletion.

Read More

  • You can read more about Auto Indexes here.
Indexes Available in all versions

Powerful Static Indexes

Harness the full potential of indexing.

With Static Indexes, your indexing capabilities are almost endless. Use LINQ functions to shape the indexation to address your needs by defining single or multiple mapping functions and reduce (aggregate) the results if necessary.

RavenDB supports the following index types:

  • Map indexes
  • Multi-Map indexes
  • Map-Reduce indexes

Each Static Index allows you to configure the behavior of each indexed field with the following options:

  • Store the data directly in index, allowing you to fetch data directly from it without the need to fetch the document from disk
  • Turn on a full-text search with an additional option to use your own custom analyzer
  • Turn on suggestions
  • Many more

You can override server or database settings regarding indexing on a per index basis or add your own custom C# code to be used during indexing.

Read More

  • You can read more about Static Indexes here.
Indexes Available in all versions

Indexing Performance and Map-Reduce Visualizers

Take a peek on what is going on internally.

As a rule, RavenDB gives you as much valuable debugging information as possible.

We created an indexing performance graph, to see indexing internals, particular steps in the process, their timings, and the amount of input and output documents. RavenDB makes indexing as transparent as possible to help you make the best analysis and take the optimal next steps.

Map-Reduce visualizer will take you into deepest abyss of the map-reduction itself. You can understand what mapping results your documents are yielding and follow reduction steps that are taking place before you reach the final result.

Extensions

Extensions

Revisions

Setup document revision creation and purging policies.

Extensions

Expiration

Define document expiration dates and schedule cleanup intervals.

Extensions

Attachments

Link binary data to your documents with ease.

Extensions

Subscriptions

Retrieve documents in a handy and reliable way for processing.

clusters

Clusters Available in all versions

High Availability

Expand beyond one node in a matter of minutes. Achieve high availability, load balancing, and failover with just a few clicks.

With RavenDB clustering is easy!

In a matter of minutes, you can configure it without any expert knowledge using our GUI management studio.

The RavenDB clustering is build on top of two layers:

  • First, the cluster layer is managed by a consensus protocol called Raft. In CAP theorem it is CP (consistent and partition tolerant).

  • The second layer, the database layer, is AP (it is always available, even if there is a partition, and it's eventually consistent) and is handled by a gossip protocol between the databases on different nodes, forming multi-master mesh and replicating data between each other.

RavenDB utilizes the different layers for different purposes. At the cluster layer, the consensus protocol ensures that operators have the peace of mind of knowing that their commands are accepted and followed. At the database layer you know that RavenDB will never lose writes and will always keep your data safe.

Clusters Available in all versions *

Cluster-Wide Tasks with High Availability *

Schedule tasks among the cluster and let the other nodes take over the work if needed.

Scheduling a backup, an ETL job, or any other ongoing process on just one node is not acceptable. If that node goes down for any reason, the show must go on. That’s is why RavenDB introduced cluster-wide tasks, assigned to a node, but owned by the cluster.

In the case of a failure of the assigned node, the RavenDB cluster will re-assign the work to another node, ensuring continuity of operations.

The following tasks can be created:

  1. External Replication
  2. RavenDB ETL and SQL ETL
  3. Backup
  4. Subscription

With cluster-wide tasks or as we are calling them Ongoing Tasks, you have a guarantee that only one cluster node is processing that job. With the high availability in place, you have assurance that the task will automatically switch to a new node if the old one is down.

Availability

  • Cluster-wide Tasks are available in all versions
  • Highly Available Tasks are available with Enterprise license
Clusters Enterprise only

Dynamic Database Distribution *

Ensure your data is safe and sound, residing on a given number of nodes.

A cluster can assign a database to all the nodes in the cluster, or to just some of them. In a five node cluster, most databases will only reside on two or three of the nodes, since duplicating all information times five is usually excessive.

Instead, you'll typically spread the databases with a replication factor of two or three on the various nodes. If a node goes down (hardware failure, for example), the cluster will note that and if it fails to come back up quickly enough, will take steps to ensure that the number of live active replicas of the database is maintained.

The cluster will do that by adding another node in the cluster for the database, resulting in another copy of the data and ensuring that the configured number of replicas is maintained. When the failed node is brought up again, the cluster will determine whatever to keep the data on the old node or to use the new topology. Your operations team doesn't have to be on their toes at all times, RavenDB is constantly monitoring and acting on your behalf within the boundaries set by your administrators.

Clusters Available in all versions

Operational Stability

Trust our experience and sleep tight.

Running a production database cluster can be a daunting task. There are a lot of knobs to turn, especially when you have co-dependent settings and options.

Far from being a opaque system, RavenDB works very hard to externalize and make visible all the details about the system that your operations team needs, and is often deployed in a self managing option.

Features such as automatic failover, dynamic distribution of tasks and databases, multi master writes means that your operations team can sleep in peace, knowing that if anything happens, they can get to it in the morning.

RavenDB also continuously runs diagnostics and self checks. Each member of the cluster is verifying each other to ensure the health of the entire system. If anything troubling shows up, RavenDB will alert the administrator, and usually include the suggested fix.

Tested in production for the past decade, RavenDB is a mature product requiring minimal guidance on day to day issues.

Security

Security Available in all versions

Certificates

Manage authentication and authorization via X.509 certificates. Secure your connectivity with SSL and TLS 1.2.

The safety of your data is always our top priority. We strive to make sure that anything your users share with you on the assumption of privacy will remain private. This does not only mean protecting your data on the disk drive (read more about this in Encryption feature), but also in transferring it securely over the wire. To achieve this, we introduced the ability to utilize the HTTPS with TLS 1.2 protocols using X.509 certificates which grants you enterprise-level security for your data during transfers over the network.

The certificates are also used to grant specific privileges to certificate holders allowing them to access only subsets of all databases on the server, or to execute operations that are allowed to one of the predefined roles (security clearances). All of this is configurable in a convenient way using our Management Studio GUI.

Read More

  • You can read more about Certificates here.
Security Enterprise only

Encryption *

Keep your data protected.

Our encryption techniques are among the best on the market.

RavenDB comes with built-in encryption support that utilizes the modern XChaCha20-Poly1305 algorithm from a well-known and battle-tested encryption library called libsodium giving you the best of both worlds: security and performance in one go.

Read More

  • You can read more about Encryption here.

Monitoring

Monitoring Available in all versions

Server Dashboard

Monitor what is going on in your Server in the blink of an eye using our built-in Server Dashboard.

The database server should not be a mystery. We invested a lot of effort to expose as much valuable information as possible. We created a Server Dashboard, part of your free Community License, to enable you to monitor in real-time aggregate crucial information like CPU usage, memory consumption, state of the databases, server traffic, storage information and much more. Now it’s easier for you to gage the behavior of your server, and take necessary resolutions if needed.

Read More

  • You can read more about Server Dashboard here.
Monitoring Enterprise only

SNMP Monitoring *

Connect Zabbix or your favorite monitoring tool via our built-in SNMP support.

When you have dozens of servers to maintain, you can hook-up one tool to monitor them all. RavenDB comes with built-in support for SNMPv2 and SNMPv3, and exposes over 50 unique OIDs for you to take advantage of.

Read More

  • You can read more about SNMP Monitoring here.
Monitoring

Real-time Logging

Turn on logging on-the-fly, and view them in the Studio. No need to restart the Server!

Administration

Administration Available in all versions *

Periodic Backups *

Schedule automatic backups to different external destinations.

RavenDB enables you to schedule full and/or incremental automatic backups, choose if those backups should be binary (slower creation, quicker restore) or JSON (quicker creation, slower restore), and choose at least one of the following destinations:

  • Local disk drive
  • Amazon AWS S3
  • Amazon AWS Glacier
  • Microsoft Azure
  • FTP

Read More

  • You can read more about Periodic Backups here.

Availability

  • Local Disk Drive backups are available in all versions
  • Cloud & Remote backups are available with Professional and Enterprise licenses
  • Binary (Snapshot) backups are available with Enterprise license
Administration

RavenCLI

Use our built-in console commands to control your Server.

Administration

Administrator JS Console

Issue JavaScript commands to modify your Server or database configuration on-the-fly without the need of any restarts.