RavenDB Master / Master Document Key Generation

45 views
Skip to first unread message

Alex Spence

unread,
Aug 21, 2014, 5:00:06 PM8/21/14
to rav...@googlegroups.com
I did some quick searching and haven't found anything explaining this in detail.  If I have RavenDB running in Master / Master configuration in 3 different datacenters, and I let RavenDB Generate DocumentKeys, how does RavenDB avoid document key collisions ?  I has been working fine for us for quite some time, but suddenly we got some serious conflicts.  I think this was due to a network outage between the datacenters... I'm just looking for a quick explanation as to how it works, I will likely start varying my keys by datacenter just to be safe.


Anders Strömberg

unread,
Aug 22, 2014, 1:22:12 AM8/22/14
to rav...@googlegroups.com
RavenDB does not do anything to avoid conflicts in document keys, each database hands out ranges of an increasing number series to each client. To handle conflicts in master-master replications have a look at the bottom paragraph of 


BR
Anders

Oren Eini (Ayende Rahien)

unread,
Aug 22, 2014, 1:55:22 AM8/22/14
to ravendb
Yes, see the Raven/ServerPrefixForHilo:.
In 3.0, you can configure that directly in the studio. 





Oren Eini

CEO


Mobile: + 972-52-548-6969

Office:  + 972-4-622-7811

Fax:      + 972-153-4622-7811





--
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.

Alex Spence

unread,
Aug 22, 2014, 11:33:06 AM8/22/14
to rav...@googlegroups.com
Thanks for the responses, I can't believe we have not run into this before.. I guess we just got lucky.  Well for now varying the key by datacenter will solve my problem but I will be more careful with master / master keys from now on.  And as soon as we can upgrade to 3.0 I will check out the new settings for server prefix.

Oren Eini (Ayende Rahien)

unread,
Aug 22, 2014, 4:27:50 PM8/22/14
to ravendb
Note that this is _already there in 2.5_, we just don't have the UI for it.
Reply all
Reply to author
Forward
0 new messages