Interview Bootcamp
Vote

0% completed

​

Designing a URL Shortening service like TinyURL

.....

.....

.....

Like the course? Get enrolled and start learning!
W

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)

Show 1 reply
Rafael Polonio

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

Show 1 reply
Jeremiah Stones

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.

Show 1 reply
Jeremiah Stones

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.

Show 1 reply
Linh Chi Nguyen

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?

Show 1 reply
Kunal Behrunani

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?

  1. 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.
  2. 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.
  3. 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
Show 2 replies
Sanskrati Agrawal

Sanskrati Agrawal

· 4 months ago

during a network partition, you cannot achieve both strong consistency and availability simultaneously. but u are saying both

Show 1 reply
Mohit Jayee

Mohit Jayee

· 8 months ago

Please put the diagram shown in the video in the course as well.

Show 1 reply
Raunak Baliyan

Raunak Baliyan

· a year ago

Hey, i think the final diagram is missing here.

Show 1 reply
Kushidhar Reddy

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.

Show 3 replies

Reading Progress

0%


Vote for new content