How to Organize a Database Table’s Keys for Scalability
Let's say I have shards that store proverbial invoices. Since each shard is a stand-alone db instance, it will have "invoices" table with auto_incremental PK. Each shard auto increments the PK value on its own and so values are not unique among shards. In such a case I cannot expose an invoice by its id. www.example.com/invoices/123 could return multiple invoices from multiple shards. Am I missing anything here?
The following post contains some helpful strategies for implementing a distributed primary keys.
Link: blog.maxindelicato.com: How to Organize a Database Table’s Keys for Scalability





Add Yours
YOU