Two simple questions:
Will any of these options create "hot" partitions?
Thanks!
If you're using a relational database as your application's source of truth, it has some variant of serial or auto-increment columns. Use those, you don't need UUIDs. They will bloat your tables and slow down your queries. Another one: non-sequential identifiers like UUIDs further destabilize keyset pagination.
Choosing Keys For example, unique Partition keys based on UUID's is ideal.
By using UUIDs, you ensure that your ID is not just unique in the context of a single database table or web application, but is truly unique in the universe. No other ID in existence should be the same as yours.
Advantages: UUID values are unique between tables and databases. Thats why it can be merge rows between two databases or distributed databases. UUID is more safer to pass through url than integer type data.
UUID is a good choice for partition key - it should be good distributed between cluster nodes. "Unique" integer is more tricky - some node need to be an authority for generation of this number, and this is hard to do in the distributed environment.
Regarding hot partition - this will depend on your data model. If you have other primary key components besides the partition key, yes - you may have this problem. For example, you generate a random UUID for sensor & starting to write a lot of data into it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With