Advice on deploying side-by-side in CI scenario to production

32 views
Skip to first unread message

Kamran Ayub

unread,
Jun 1, 2015, 2:10:26 PM6/1/15
to rav...@googlegroups.com
Hey all,

I really like the idea of side-by-side index deployment, especially for production. I was thinking, why shouldn't I just replace this:

IndexCreation.CreateIndexes(...);

with:

if (production) {
  IndexCreation.SideBySideCreateIndexes(...);
} else { ... }

However, trying that locally, I noticed it appears to do side-by-side replacement (and re-indexing) even if the index definition is the same. I believe this is by design, but should it be? Wouldn't it be advisable to use side-by-side deployment to production in many cases? I use CI and CD for production deployment, so it would definitely make it a smooth deployment scenario if users didn't have to wait for re-indexing when I update my indexes.

Would there be a consideration to add an option (or by default) check to see if the index definitions are actually different and only then perform the replacement? Could I write this logic myself? This all happens in App_Start once anyway.

Chris Marisic

unread,
Jun 1, 2015, 3:09:18 PM6/1/15
to rav...@googlegroups.com
CreateIndexes should never cause an index that has had zero modifications to reindex. 

Or are you saying that SideBySide will cause indexes to reindex even with no differences? I've never used SideBySide

Kamran Ayub

unread,
Jun 1, 2015, 5:28:25 PM6/1/15
to rav...@googlegroups.com
Yes, switching to SideBySideCreateIndexes will cause the replacement ones to re-index, even though the indexes they are replacing don't have any changes. I would expect only changed indexes to create a side-by-side replacement, basically the same behavior as you mentioned.

Chris Marisic

unread,
Jun 1, 2015, 6:37:00 PM6/1/15
to rav...@googlegroups.com
I would call that a bug.

But i would expect you can easily work around it by looking at the source of CreateIndexes and invoke the same parts that compare index definitions if you want to in the short term.

Kamran Ayub

unread,
Jun 1, 2015, 7:20:57 PM6/1/15
to rav...@googlegroups.com
Oh, good thinking! I'll probably do that for now.

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

Paweł Pekról

unread,
Jun 2, 2015, 1:59:55 AM6/2/15
to rav...@googlegroups.com
I can confirm that this was a bug. Fixed few days ago: https://github.com/ayende/ravendb/pull/2253

Kamran Ayub

unread,
Jun 2, 2015, 3:27:12 AM6/2/15
to rav...@googlegroups.com

Good to know! Thanks.


--
Reply all
Reply to author
Forward
0 new messages