I searched for some articles or best practice guidelines for generating id (for federated / primary key) for Azure Federated databases and did not find anything convincing. Federated tables do not support identifier columns, so it seems to me that the only practical type of identifier is a GUID, since trying to centrally create and use BigInt creates a single point of failure in the application. My main problem is the consequences of using a GUID for BigInts (especially for indexing tables).
Is there any recommended / best practice (or existing libraries) for creating unique BigInts for a distributed system (or should I not worry about the consequences of using a GUID?).
[Update]
After reading a lot more about this, starting with posting the question, it seems to me that the key generation will be a problem in Azure. According to a blog post from Microsoft, it is recommended that you use a GUID as a Federated key. However, they do not mention that all indexes (including cluster indexes) in Federated tables must contain a combined key. This means that all of these indexes will contain a GUID that will kill insert performance.
An alternative, apparently, is to use a centralized key generation service (as mentioned by Simon below), which has its drawbacks in terms of the potential bottleneck and central point of failure.
I would think that Microsoft would have more confidence in this, as this is certainly the problem that all federated tables that create will face!
In balance, I decided to go with a centralized key generation service, but that bothers me a bit. If someone has some kind of magical technique, I would love to hear that (or let me know if I missed something obvious)!
Mike hanrahan
source share