RavenDb configuration and DocumentStore abstraction?

I am using RavenDb for several projects and solutions to access three different databases that are part of the same product. For example, I have several MVC projects that retrieve user information and some data from a "web based database" and a "backend" database using "-" to override the id (but I only need that for a subset of the classes in " web "db). And then I have another database "backend" that is used by the services (as well as MVC projects). And finally, the third temp / scratch database, which I use with another set of services to create the backend backend. And, of course, they are all available from different class libraries and even for test applications for testing, seeds and integration.

Managing it all gets pretty frustrating. Every time I create a new console app or class library that accesses the db, I need to set up config and raven packages for each project, make sure indexes are built, etc. Not to mention running an update for all nuget updates, or in my case, installing a new unstable version of the server / client binaries.

Is there an easier way to handle this?

I have tried to abstract the creation and initialization of the DocumentStore, and the creation of the index into and reference to its own project. But other projects had to manually add newtonsoft.json (and nlog) from the packages directory.

Also, I get the following when I try to abstract the DocumentStore into a class with a static property: The StackTrace of an unopened document store is written. Make sure you store any document storage in your tests to avoid race conditions in your tests.

Anyone have any thoughts on how to solve these problems?

thank

+3


source to share


1 answer


I don't think manually adding links is a big problem, but you can add links to nougat as well. Note that the DocumentStore error that has not been removed is something that only happened in unstable (debug builds) and will not occur on release builds.



-2


source







All Articles