Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RavenDb and MultiTenancy

I have looked and played around with RavenDb for a while and have started to look at MultiTenancy. Ayendes sample for multitenancy looks like this:

using(var store = new DocumentStore
{
    Url = "http://localhost:8080"
}.Initialize())
{
    store.DatabaseCommands.EnsureDatabaseExists("Brisbane");

    store.DatabaseCommands.EnsureDatabaseExists("Melbroune");
    store.DatabaseCommands.EnsureDatabaseExists("Sidney");

    using (var documentSession = store.OpenSession("Brisbane"))
    {
        documentSession.Store(new { Name = "Ayende"});
        documentSession.SaveChanges();
    }
}

I don't know how each database is stored and hence the question: Will that work for large applications with a lot of tenants?

like image 632
jgauffin Avatar asked Sep 09 '11 16:09

jgauffin


People also ask

What is the difference between multitenancy and virtualization?

In a multitenancy environment, multiple customers share the same application, in the same operating environment, on the same hardware, with the same storage mechanism. In virtualization, every application runs on a separate virtual machine with its own OS.

What is meant by multitenancy?

Multitenancy is a reference to the mode of operation of software where multiple independent instances of one or multiple applications operate in a shared environment. The instances (tenants) are logically isolated, but physically integrated.

What is multitenancy in SaaS?

In its most basic definition, multi-tenancy is an architecture in which a single instance of a software application services multiple customers, or tenants. Multi-tenancy can be economical because software development and maintenance costs are shared.

What is multitenancy in IAAS?

Multitenancy is a software architecture where a single software instance can serve multiple, distinct user groups. Software-as-a-service (SaaS) offerings are an example of multitenant architecture.


1 Answers

See the first and last paragraphs from the docs (v2.5 | v3.0).

RavenDB's databases were designed with multi tenancy in mind, and are meant to support large number of databases on a single server. In order to do that, RavenDB will only keep the active databases open. If you access a database for the first time, that database will be opened and started, so the next request to that database wouldn't have to pay the cost of opening the database. But if a database hasn't been accessed for a while, RavenDB will cleanup all resources associated with the database and close it.

That allows RavenDB to manage large numbers of databases, because at any given time, only the active databases are actually taking resources.

So yes it will support it and each database will be stored in a separate folder on disk.

like image 143
Matt Warren Avatar answered Oct 18 '22 20:10

Matt Warren