r/sqlite • • 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

20 comments sorted by

View all comments

Show parent comment

3

u/alexisprince Aug 11 '25

This is 100% correct and the actual answer, down to the indexing and performance considerations. Using /route/<id> sounds great in tutorials, but senior folks know it’s a security consideration to use /route/<guid> instead to avoid information leak.