





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






Handout: 17 th^ November 2020 Due: 24 th^ November 2020 by 6pm Discussions: 18 th^ and 25th^ November 2020 in the tutorial
This exercise aims to teach you how to design a system from scratch. It consists of two parts.
Note, you are asked to draw a systems diagram as the last exercise of Part 1. We recommend completing this diagram bit by bit while you complete the other exercises.
Furthermore, we recommend arguing your design in terms of the requirements identified in the first two questions. If you notice that you are missing some requirements as important constraints for a later decision, add them and shortly consider if that changes your design up to that point.
Finally, we recommend not to read the model solution before completing Part 1.
The task is to propose a high-level system design for an url shortening service. Examples for these services can be found online, e.g. TinyURL, bit.ly, goo.gl or qlink.me. If you have never used one of these, we recommend taking a moment to try one.
URL shortening services create smaller aliases for urls, e.g. https://de.wikipedia.org/wiki/Cloud_ Computing to https://bit.ly/35p91vt. This saves a lot of space when the URL is displayed, printed, messaged or tweeted.
Hint: start with around 4 and prioritize them.
Hint: start with around 4 and prioritize them.
Assume that the service has a read to write ratio of 100:1, and an estimated load of 500 million newly registered URLs per month, which expire after 5 years. Please give a formula and a final estimate for the following operations and report the estimate in full hundreds or thousands:
As stated in the Capacity estimation exercise (Section 1.3), we expire aliases after 5 years. Describe a system component that can do this. Hint: you might notice that incorporating this into your design from the beginning could influence it a lot.
Generally, there are two kinds of partitioning used in practice: range partitioning and hash partitioning. Which one is more suitable?
The generated aliases should be as short as possible. The aliases should be human-readable and look like a normal url. Therefore, you should use Base64 encoding. This encoding uses 64 different characters: [A-Z, a-z, 0-9, +, /] and each character is encoded using 6 bits. Some background reading: https: //en.wikipedia.org/wiki/Birthday_attack
Previously, we made the assumption that the 80-20 rule applies to our workload and hinted that it could be used for caching.
Do not read past here, before completing Part 1.
Part 2: Comparision with a model solution
You should read this part after finishing Part 1.
We are not the first to ask others to design a url shortening service. A well-written model solu- tion can be found at https://www.educative.io/courses/grokking-the-system-design-interview/ m2ygV4E81AR. This is a system design exercise, there is no single correct answer. So do not worry if you came up with a different design. Please read the model solution and write a brief comparison to your design. All components of the model solution are shown in Figure 1. We did not discuss load-balancers, so it is normal that your design does not cover them.
Figure 1: Detailed component design for URL shortening