2 ms·
A simple use case is incrementing a >53-bit integer id.
by koolba 9y ago
A simple use case is incrementing a >53-bit integer id.
- nom 9y agoWhen you need incremental ids that large, you're doing something wrong. At the current rate (6000 tweets per second), twitter will run for >47600 years with 53 bit.
- koolba 9y agoSure if you only have one system generating the ids. Once you deal with distributed systems, you need some "fat" to prevent duplicate ids from being generated. That's usually done with an N-bit prefix identifying the server plus a time stamp prefix.
- Udik 9y agoThere, problem solved for both the developers that need it: https://www.npmjs.com/package/big-integer https://www.npmjs.com/package/big-integer :)