Back to course home
0% completed
Vote For New Content
How do we make sure KGS won't generate duplicate keys?
Yifeng Chen
May 25, 2023
As titled, if KGS is randomly generating keys, or hashing current timestamps, etc. How can we make sure it will not generate a duplicate key that has already been generated and moved to the used key store or loaded into memory cache?
0
0
Comments
Comments
S
Sid a year ago
The moment the keys are taken off and stored in the cache, they are marked as used. This can be a backend process where KGS generates keys handling collisions and then periodically placing them in memory cache or it could be based on a threshold reached in the Cache whi...
On this page
- Why do we need URL shortening?
Try it yourself
Designing URL Shortener (video)
- Requirements and Goals of the System
- Capacity Estimation and Constraints
- System Interface Definition
- Create Short URL API
- Redirect API
- Analytics API
- URL Management API
- Delete Short URL API
- Database Design
- Basic System Design and Algorithm
a. Encoding actual URL
b. Generating keys offline
- Data Partitioning and Replication
- Cache
- Load Balancer (LB)
- Purging or DB cleanup
- Telemetry
- Security and Permissions