Why there are a HiLo series per collection instead a global HiLo series?

29 views
Skip to first unread message

Ivan Montilla

unread,
Aug 31, 2020, 11:24:55 AM8/31/20
to RavenDB - 2nd generation document database
There are any reason why there are a HiLo series per collection instead a only one series used globally? Any performance reason?

Modify the conventions for generation HiLo IDs without collection part and incrementing HiLo regardless the collection.

First document in DB:
{
    "Id": "1-A",
    "GivenName": "John",
    "FamilyName": "Doe",
    "@metadata": {
        "@collection": "Customers",
        "Raven-Clr-Type": "MyProject.Entities.Customer, MyProject"
    }
}

Second document in DB:
{
    "Id": "2-A",
    "OriginNumber": "+34111111111",
    "DestinationNumber": "+34222222222",
"Duration": "00:12:34"
    "@metadata": {
        "@collection": "Calls",
        "Raven-Clr-Type": "MyProject.Entities.Call, MyProject"
    }
}

Differentes entities, differents collections, but sharing HiLo series and without collection name into the ID. Is this a good or bad idea? There are any reason to not doing this?

Oren Eini (Ayende Rahien)

unread,
Sep 6, 2020, 5:58:35 AM9/6/20
to ravendb
There is no reason _not_ to do that, but we matched the expected sequence per collection because that is what users usually want.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/0ec986e9-31a5-43ad-a134-4e53fe1eec5cn%40googlegroups.com.


--
Oren Eini
CEO   /   Hibernating Rhinos LTD
Skype:  ayenderahien
Support:  sup...@ravendb.net
  
Reply all
Reply to author
Forward
0 new messages