Embedded
RavenDB makes it very easy to be embedded within your application. The first step is to reference the embedded client, either via nuget (package name: RavenDB-Embedded) or by taking the files from the build zip.
After referencing the embedded client from your project, all that is left to do is initializing:
var documentStore = new EmbeddableDocumentStore
{
DataDirectory = "Data"
};
HTTP access
By default you don't have an external access to RavenDB, so if you want to use the WebUI to look at what the database is doing, or to use the REST API, you can't. Other features relying on being able to communicate over HTTP (like replication) will be disabled too.
RavenDB can be run in an embedded mode with HTTP enabled. To do that, you will just need to set another flag when initializing the embedded document store:
var documentStore = new EmbeddableDocumentStore
{
DataDirectory = "Data",
UseEmbeddedHttpServer = true
};
Note that you may want to call NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(port) to ensure that you can open the HTTP server without requiring administrator privileges.
Once you initialized the document store, you can browse directly to the WebUI, execute replication scenarios, etc.
Configuration
Many configuration options are available for tuning RavenDB and fitting it to your needs. See the Configuration options page for complete info.
The comments section is for user feedback or community content. If you seek assistance or have any questions, please post them at our support forums.
Is it possible to read the content of an embedded database using the Raven Studio application (Raven.Studio.xap), or something similar?
Yes, you can do it by doing:
UseEmbeddedHttpServer = true on the document store.
I've written a step by guide to getting RavenDB embedded up and running, including Management Studio. http://www.dalsoft.co.uk/blog/index.php/2012/04/12/mvc-get-ravendb-up-and-running-in-5-minutes-using-ninject/
Is the embedded dB thread safe? I would like to use it as an in-process cache in a Web application to minimize SQL db calls.
Yes, RavenDB, in all modes (server, cloud, azure) is fully thread safe
Hi! Is it possible to browse database Embedded in Windows Forms application using Management Studio?
Yes, you can set UseEmbeddedHttpServer, see discussion on that in this page
I tried to add UseEmbeddedHttpServer = true setting, but initialization returns HttpListenerException: "Access is denied"
You have to be admin
Thanks a lot for help!!! Running as admin solved my problem.
If you're starting out with a new store, make sure you Initialize() it first before accessing the Management Studio.
PM> Install-Package RavenDB-Embedded Install-Package : Unable to find package 'RavenDB-Embedded'. At line:1 char:16 + Install-Package <<<< RavenDB-Embedded + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
Please ask in the mailing list, this is not the place for support questions