News for hackers. Stuff that matters.
Re:Does it scale? Who cares (2011) by virmundi on Saturday April 08, 2017 @11:47PM (#14070317)
I've literally been waffling back and forth between UUID and BigInt for the last week. The reason for this is I need to handle eventually distributed systems. Do I need UUIDs? Maybe not, but after much debt, I've decided that the storage requirements of such an index in memory is worth the ability to move from Postgres to Postgresql-xl.
Re:Does it scale? Who cares (2011) by ProblemFactory on Sunday April 09, 2017 @09:12AM (#14072109)
> Do I need UUIDs? Maybe not, but after much debt, I've decided that the storage requirements of such an index in memory is worth the ability to move from Postgres to Postgresql-xl.

There is a major benefit to UUIDs besides server-side scaling concerns: you can generate them offline in mobile apps and other client-side applications.

With serial primary keys, you are often stuck between waiting for a server round trip before saving data locally, or inventing complicated solutions for referring to not-yet-uploaded data locally.

Re:Does it scale? Who cares (2011) by qaq on Saturday April 08, 2017 @11:51PM (#14070336)
The problem is not with memory problem is that after checkpoint postgres will do full page writes for serial you will be touching way fewer pages compared to UUID so write amplification for UUID vs bigint can be 60X+
Re:Does it scale? Who cares (2011) by virmundi on Sunday April 09, 2017 @12:02AM (#14070369)
Can you go into a bit more detail? I've seen amplification referenced before. My estimation is that the database will be pretty much read heavy. I will need to split a given database across multiple instances.
Re:Does it scale? Who cares (2011) by qaq on Sunday April 09, 2017 @12:15AM (#14070425)
https://blog.2ndquadrant.com/on-the-impact-of-full-page-writ... this is fairly detailed analysis of this issue
Re:Does it scale? Who cares (2011) by virmundi on Sunday April 09, 2017 @12:47AM (#14070526)
Thank you. I'm reading over it now and for the next few days (to really grok it). I do wonder how bad it will be for low write situations. At the same time I'm open to switching to BigInt and using Postgresql-xl.
Re:Does it scale? Who cares (2011) by Dylan16807 on Sunday April 09, 2017 @04:05AM (#14071049)
How about simply using non-random UUIDs?
Re:Does it scale? Who cares (2011) by qaq on Sunday April 09, 2017 @10:57AM (#14072578)
That would def. help
Re:Does it scale? Who cares (2011) by graphememes on Sunday April 09, 2017 @01:49AM (#14070707)
luid, check it out