igorbenav / FastAPI-boilerplate

An extendable async API using FastAPI, Pydantic V2, SQLAlchemy 2.0, PostgreSQL and Redis.
MIT License
589 stars 69 forks source link

Switch from UUID v4 to v7 #126

Open CHE1RON opened 6 months ago

CHE1RON commented 6 months ago

Describe the solution you'd like Migrate to using UUID v7 (uuid6 package, which despite its name provides uuid7() fn) as data type for id columns.

Additional context These articles outline advantages of v7 (as opposed to v4), and also some pitfalls of not doing so:

Link 1 comes with very detailed information about all UUID implementations (benchmarks included), Link 2 provides a well-rounded writeup on implications for PostgreSQL in particular!

igorbenav commented 6 months ago

Very nice issue, @CHE1RON! Thanks!