# URL Shortener

• -10

Question: How many URLs will we need to handle in the next 5 years? 1
Hint: Earlier we saw, we would see 100 Million new URLs each month. Assuming same growth rate for next 5 years, total URLs we will need to shorten will be 100 Million * 12 * 5 = 6 Billion.

• -6

Question: How many URLs will we need to handle in the next 5 years? 1
Hint: Earlier we saw, we would see 100 Million new URLs each month. Assuming same growth rate for next 5 years, total URLs we will need to shorten will be 100 Million * 12 * 5 = 6 Billion.

• 1

Do the tiny urls need to have an expiry time ?

• 1

lokesh91ag 11 months ago

yes

• 0

why should there be any expiry time?? any particular logic...

• 0

The simplest one is that the owner wants to set the expiry time or if there is no activity from past x months then we can automatically expire that URL.

• 2

QPS:100 million / month
= 3 million / day (100m/30)
= 125000/hour (3m/24)
= 2083 / minute (125000/60)
= 34 / second ( 2083/60) (for create)

Retrieval:
1billion / month (10write) = 340/second (10write)

• 0

isn't the index size of total 3TB <hash key, URL> data 36GB?

• 0

I am also having the same doubt. We need to index only hashes (6 bytes each). And total size is 6 billion entries => 36GB data. I guess this can easily fit into a single machine of 72GB RAM.

• 0

Titan99 9 months ago

If we have QPS of 400 (given in question), and expected QPS to stress server is 50 (say), then we need 400/50 = 8 machines atmax, and we need to save 3TB (For saving actual urls as values) + 36GB (for saving shortened urls as keys) data. So we need 8 machines of (3 TB + 36 GB) / 8 = 380 GB appox each.

• 0

kumar_pratyush 12 months ago

1157.407407407407

• -2

deepak_singh_603 11 months ago

• 2

qqldd 7 months ago

x^62 > 610^9 should be 62^x > 610^9.

• 0

sindhusree_gajjela 4 months ago

high availability of the system

• 0

sindhusree_gajjela 4 months ago

new urls per month: 100 million

• 0

vedanshu_dahiya 4 months ago

chzixcz

• 1

anand.ratn 4 months ago

How to deal with duplicate url ? In this case system will generate a new show url for the same url.

• -1