0% completed
Designing a URL Shortening service like TinyURL
This case study follows the seven-step interview method. Use the System Design Master Template while you work through it.
Imagine that you want to share this address:
https://www.designgurus.io/course/grokking-the-system-design-interview
The address works, but it is long. It takes space in messages, printed material, and social media posts
.....
.....
.....
wac.almeida
· a month ago
To be honest, I prefer reading to watching videos, and I was trying to design before reading the whole content. However, the requirements at the beginning of the post and the video are different; the whole design I have produced was very different (for example, it doesn't mention the analytics as a functional requirement)
Rafael Polonio
· a month ago
What is the downside of removing the API gateway and having just one service?
A service for shorten the url and a service for redirects looks an overengineering
Jeremiah Stones
· 2 months ago
Security was mentioned as one of the key non-functional requirements, but not covered in the video... The API design mentioned passing User ID without mentioning using a JWT or opaque session token.
Jeremiah Stones
· 2 months ago
I'd use DynamoDB for the URL DB. MongoDB could certainly handle it, but its flexible document model does not buy you much here. The record shape is simple, and there is one overwhelmingly dominant lookup pattern. MongoDB’s flexibility is valuable when documents vary or require richer document-oriented queries, neither of which is central to the redirect path.
Linh Chi Nguyen
· 2 months ago
hi, why do we need md5 or sha if we can simply do a crypto.randomBytes() instead.
and what is the difference bw 301 Vs 302 redirect?
Kunal Behrunani
· 3 months ago
Our KGS (Key generation system) also introduces a new problems - How to ensure it creates a new key that is not used before?
- We use math.random() to fill the 6 spaces to generate our short url code, But in that case we'll have to query the existing keys, to ensure the key does not exist previously. Though, this can be optimised using Bloom Filters but it is still not a very recommended approach.
- We can try other algo like nextPermutation() which can create next permutation in an ordered fashion. It's better because we're sure the next permutation key will not be consumed earlier and do not need to check anywhere in DB.
- But it'll make our keys too predictable. To tackle that, say we maintaining 7 char keys. So we've a total range of 62^7 values. Inspired by the principles of
Sanskrati Agrawal
· 4 months ago
during a network partition, you cannot achieve both strong consistency and availability simultaneously. but u are saying both
Mohit Jayee
· 8 months ago
Please put the diagram shown in the video in the course as well.
Raunak Baliyan
· a year ago
Hey, i think the final diagram is missing here.
Kushidhar Reddy
· 2 years ago
Hi, how does all the databases are in sync when the load balancer (before api gateway) distributes the requests to multiple servers. There can be conflicts, how they are resolved.
Reading Progress
0%