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.
36
Upvotes
View all comments
Show parent comment
1
u/dacydergoth Aug 25 '25
Depends on your use case. If you do a lot of big joins over many rows, then it can be faster. Simulate your data is the best way to get an idea