Deploying Static Indexes

23 views
Skip to first unread message

David Brower

unread,
Aug 27, 2015, 1:12:07 AM8/27/15
to RavenDB - 2nd generation document database
We're currently evaluating RavenDB for our new system and I have been looking at static indexes.

What I haven't yet found is a clear story on the best practice for deploying static indexes to a new instance of a Raven Db instance. If we create our indexes as C# classes in what kind of project do we maintain them in? How do we then deploy these indexes to a new db?

Oren Eini (Ayende Rahien)

unread,
Aug 27, 2015, 1:17:45 AM8/27/15
to ravendb
The idea behind writing static indexes in C# is to make it _easy_ to work with them.
That accounts for all aspects of the index lifetime.
Using C# classes for index definitions means that they are versioned right along with your code, you have the compiler letting you know about any errors, etc.

Deploying static indexes from code is done using:

IndexCreation.CreateIndexes(assembly, documentStore);

They are usually kept in the same project as your entities classes.

See the full docs:


Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


On Thu, Aug 27, 2015 at 12:09 AM, David Brower <david...@hotmail.com> wrote:
We're currently evaluating RavenDB for our new system and I have been looking at static indexes.

What I haven't yet found is a clear story on the best practice for deploying static indexes to a new instance of a Raven Db instance. If we create our indexes as C# classes in what kind of project do we maintain them in? How do we then deploy these indexes to a new db?

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Marisic

unread,
Aug 28, 2015, 10:32:31 AM8/28/15
to RavenDB - 2nd generation document database
I'd add that during development it's great to run CreateIndexes on every AppDomain start, but not for production. I recommend production require and admin button push to invoke CreateIndexes.

RavenDB3 has a concept called side by side indexing, that allows for better management of online site changes. Combining that with feature toggles will allow you to deploy seamless updates 
Reply all
Reply to author
Forward
0 new messages