Open hifall opened 6 years ago
@hifall for request id generation you can try generators with random part as server instance id and predictable (increment) part as request number:
ODI2YmQ3ZDktNzM4Ni00ZTA0LWE/42
)pref.GtxXQ.42
, with customizable prefix and length)This way you are safe from request id collisions.
Thanks @yentsun, will check the links out shortly!
We have an SaaS app where many (potentially thousands) of client SPA's (Single Page Application) issue requests to the server.
In order to filter duplicate requests: 1 each request hits the server with an ID; 2 each time a request comes in, the server checks the request's ID -- if processed, simply ignore; otherwise proceed as usual;
Is
shortid
good for this purpose? How likely 2 or more SPA instances generate the same ID usingshortid
?Thanks!