Viewing a single comment thread. View all comments

WindTalk OP wrote

Emma, quick question. Why did you go with a uuid for id on forum_subscriptions table as opposed to just a bigint like the id of submission_votes table?

2

[deleted] wrote (edited )

2

WindTalk OP wrote (edited )

Thank you for taking the time to share. My thoughts are: UUID takes more storage, so RAM caching is going to be hit. And the overhead of doing the 'next number in sequence' is only on the insert, right? In this example, a user is going to be reading forum_subscription membership table every time they refresh their home page for new posts (reading from server RAM cache) - but inserts are very rare (joining a new forum)... so it seems to me the bigint has the greater advantage?

http://thebuild.com/blog/2015/10/08/uuid-vs-bigserial-for-primary-keys/

2

[deleted] wrote (edited )

1

WindTalk OP wrote

The other advantage of UUID is multi-master replication. Independent servers can create new inserts while other servers are unreachable.

2