4 ms·
Isn't it unsafe to expose internal database IDs to external clients? I would have generated a second GUID for public view.
by silverlake 11y ago
Isn't it unsafe to expose internal database IDs to external clients? I would have generated a second GUID for public view.
- wereHamster 11y agoBut how do you ensure that it is unique?
- stevecalifornia 11y agoYou will have a mapping table: Public_Guid, Private_ID Every request has to convert the public, non-guessable GUID into the private ID that will be used in the lookup query.
- silverlake 11y agoTwitter's Snowflake, though it's gone now. The principle is the same. https://github.com/twitter/snowflake https://github.com/twitter/snowflake.
- brianwawok 11y agoDepends on what the GUID lets you access, right? If GUID got you into a bank account, opps. If it gets someone access to an already public picture... not a huge deal, right?