Short GUID generation
sandeepzgk opened this issue · comments
Sandeep Zechariah George commented
In https://github.com/sandeepzgk/iOSHapticTestPlatform/blob/main/server/handler.js
For function app.post("/setExperiment", async function(req, res) around line #66 we have a
- while loop that generates a short guid
- checks if it is unique within the db
- if its unique continue
Issues
- this may not be scalable, because the database is setup to be eventually consistent, so collisions may occur.
- How can we improve this without performing a dynamoDB scan operation, (scan operations are costly)
- rename it from calling it expid to guid or something more generic like uid, it cannot be guid because guid is globally unique, this needs to be unique within the system, so a short unique.