Back to course home
0% completed
Vote For New Content
What's the point of key generation service and all the complexity related to it?...
Haixiao Yang
Jun 23, 2022
What's the point of key generation service and all the complexity related to it? Just to avoid generate duplicate short url for the same long url? We can just use a encoding algorithm with salt (BASE64(SAH256(long url , salt))). The salt can just be a random generated number.
3
0
Comments
Comments
G
Grayson W3 years ago
Salt does solve the issue of duplication. As far as I understand, part of the reasons to generate keys offline are:
- Base64 on MD5 will result in 21+ charaters, but we want 6-8 chars.
- If we only pick 6-8 from these 21+ chars, we can easily have duplications, unless...
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