Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> surrogate keys can be fixed size integers

This launches into the other debate about PKs: using UUIDs rather than sequential keys.



This is less of a debate, and more of an indicator of who has had to work with a DB at scale using UUIDv4 everywhere.

Don’t blow up your B+trees.


I guess.

Either your system is happy enough to route every new entity through "one DB at scale" so it can let your "one DB at scale" be in charge of an auto-incrementing long, or it isn't.


A common method is to have a small app (which can quite easily be HA) that hands out sequential chunks to each shard, interleaving and/or gapping as necessary.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: