Menu
Back to Discussions

ap design when to use uids vs sequential ids

hey, so i've been chewing on API design lately, especially when it comes to picking identifiers. for primary keys, both in our databases and then out in our APIs, what do you think? should we go with UUIDs or just stick to the old-school sequential integers? both have good and bad points. UUIDs are pretty sweet for distributed setups and they don't spill the beans on how many records you have. but, they can be a drag on indexing performance and are kind of a pain to read. sequential IDs? they're straightforward and fast. the downside is they can totally give away internal system details and get tricky in some distributed situations. what's your usual approach, and what's your reasoning? what have you actually run into, like in the real world, and what trade-offs did you have to make
38 comments

Comments

Loading comments...