What is the common use case when I need to use a UUID as the primary key for a Rails application

I was researching the opensourced Rails project and saw that they use UUIDs as primary keys instead of IDs. I've seen on some blog posts that it loses the sequence that comes with auto-incrementing like we do with IDs.

Then I will try to find if the UUID should be used as the table. I've seen some of the benefits illustrated by this post , but he mentioned that it's rarely worth using a UUID unless there is a lot of traffic and multiple database servers on the website.

So, I'm wondering in real life, is it worth implementing UUIDs as the primary right from the start for an e-commerce application in Rails? Moreover, Rails 4 can now support uuid out of the box.

+3
uuid ruby-on-rails postgresql


source to share


No one has answered this question yet

See similar questions:

2
why use apps to generate custom uuid instead of database id?

or similar:

471
How to reset postgres' primary key sequence when it gets out of sync?
12
UUID injection as primary key
7
PostgreSQL using UUID vs Text as primary key
7
How to migrate a complex Rails database to use Postgresql primary UUID keys
4
Should I use UUIDs as primary keys for Rails?
4
using UUID as primary key in rails and polymorphic relationships
2
Create a unique identifier for DynamoDB with fewer bits than UUID
2
How do I implement primary keys composed of UUIDs instead of auto incremental integers for Laravel Rloquent models and their relationships?
1
How to create migration using uuid primary key
1
Ruby on Rails - Implementing UUID as Primary Key with Existing Schema



All Articles
Loading...
X
Show
Funny
Dev
Pics