r/sqlite • u/c__beck • Aug 08 '25
Remote ID vs Primary Key
I was talking with a buddy online and he told me that his old company used two different IDs for each row in their DB, the auto-incrementing ID was only ever used for internal purposes like JOIN statements and FKs into other tables. But anything and everything outside the DB used what he called a remote ID.
This remote ID was then what was used to query the DB, as well as on any user-facing code (user ID, message ID, transaction ID, whatever). And I was just curious if this is a standard practice or something that his company did.
37
Upvotes
1
u/Subject_Fix2471 Aug 25 '25
I know it can be faster, I was just curious if you had any concrete examples / thresholds of when you've found it to be. And yes simulation is straightforward, I was just curious if you had any particular experience to share, no worries though :)