forked from OpenUnited/platform
-
Notifications
You must be signed in to change notification settings - Fork 1
Why Base58UUIDv5Fields for primary keys?
Adrian McPhee edited this page Oct 12, 2024
·
1 revision
| Factor | Base58UUIDv5Field | Incrementing Integers |
|---|---|---|
| Global Uniqueness | Ensures global uniqueness, ideal for distributed systems | Only unique within a single database instance |
| Deterministic IDs | UUIDv5 can be deterministic based on namespace and name | IDs are not deterministic |
| Scalability | Scalable across distributed systems, no need for central control | Centralized sequence can become a bottleneck |
| Compactness | Base58 encoding creates short, URL-friendly IDs | Compact at first but grows over time |
| Security | Harder to guess or predict, adds security by obfuscation | Easy to guess and expose internal system details |
| Multi-Tenancy | Easy to implement without risk of collisions | Requires extra complexity to manage unique IDs across tenants |
| URL Friendliness | Base58 avoids problematic characters like / and +
|
Integer IDs are URL-friendly but predictable |
| Sequential Disclosure | No inherent order, prevents leaking creation order | Reveals the sequence in which records were created |
| Standardization | UUID is a standard format, widely supported across platforms | Limited to internal databases, not a widely used format in distributed systems |
| Merging & Migration | Easily merge or migrate data across systems without conflicts | Conflicts are likely when merging data from different databases |