RavenDB, only way to store data with embedded db is in "system database"?

I'm using an embedded database and wondering if the only way to work with data is using the system database? I looked into management studio and saw that all my data was being dumped into the system database. Even when I created a new database in management studio, this new db remained intact. Using a code-behind approach I didn't get much more because it seems that multiple leases are not supported inside inline instances. So the only way to store and access data from the SYSTEM database?

thank

+3


source to share


2 answers


It is right. Embedded mode is designed to work with a single database, which is also a system database. It does not currently support other "tenant" databases.

If you need a small number of different databases, you can create multiple embedded databases. Each needs a separate EmbeddableDocumentStore instance and a different path specified for the data directory.



If you are developing something that requires a lot of databases, inline mode is not suitable.

+5


source


If you give your file store a default database name, your data will be stored in that database.



var documentStore = new EmbeddableDocumentStore
{
    DataDirectory = "Data",
    DefaultDatabase = "MyDb"
};
documentStore.Initialize();

      

0


source







All Articles