Live data from Hacker News

This is the only Postgres schema you need, change my mind

news.ycombinator.com

1–10 of 15 posts

Re: This is the only Postgres schema you need, change my mind

#6
Given schema is limited to where uuid v4 usage is relevant/appropriate.

uuid version 7 more appropriate for keys in high-load databaseses and distributed systems.

Issues if need something other than uuid_v4. aka v8,

snowflake_id bit more compact than separate uuid_v4 & timezone

json, "blob" storage, not efficent for/optimized for search/replace operations. Json blob will need to be normalized every time data cached. File system storage with uuid_v7 index less overhead.

Re: This is the only Postgres schema you need, change my mind

#7
post #5

Care to example some usage cases? And why uuid over auto-increment sequenced number?

An auto-incremented sequenced number can leak business information that one may not want to leak. Such as number of customers, transactions, documents…

Sometimes it’s fine and the simplicity is worth it if you aren’t dealing with a distributed database, but a random uuid is a better default in my opinion.

Re: This is the only Postgres schema you need, change my mind

#10
post #9

Tell me you have never built a real world production application without telling me you have never built a real world production application.

Doing this on 2 apps

200k users a month, not huge but not nothing

Why do you think it's a bad schema?

Post reply on HN