Back to course home
0% completed
Vote For New Content
Another option instead use the KGS - randomUUID.
Andre Lucas Santos Silva
Jul 24, 2023
Hello folks. I was thinking about the KGS implementation, and after thinking about that.
Could I suggest in the system design interview generated to each URL shortened with the unique ID together?
Something like this:
var pk = (); var shortenedUrl = pk + "-" + originalUrl var keyShortenedUrl = ("SHA-256").digest(shortenedUrl) repository.save(new Model(pk, originalUrl, ("%032X", new BigInteger(1, keyShortenedUrl))));
In this way, I think that we can't key duplication/collision between the keys shortened. What do you about this?
2
0
Comments
Comments
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