sandeepzgk / GameProbe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Short GUID generation

sandeepzgk opened this issue · comments

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

  1. while loop that generates a short guid
  2. checks if it is unique within the db
  3. if its unique continue

Issues

  1. this may not be scalable, because the database is setup to be eventually consistent, so collisions may occur.
  2. How can we improve this without performing a dynamoDB scan operation, (scan operations are costly)
  3. 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.