System Specs
- Build a tiny url like website that can support 1 trilion short urls.
- Average paste of the content would be 1 KB
- Most popular clicks can be in million, average urls have 10k clicks.
What specific pattern are we solving for here ?
- Generating Unique short random strings.
- how to get the click counts for an item.
System type
More reads, less writes in comparision. (We need caching in these cases)
Write throughput: How to handle it ?
Possibilties are high, we need a faster throughput, because as soon as user generates as link, he copy and pastes it and we need an instant redirection. So writes for us are critical.
- Multi Leader system
- Write back cache
- Partitioning the data, helps in writes as well.
New stuff
1. Predicate locks
2. Which database engine to use?
1. B-Trees
1. Good for reads bad for writes
2. LSM
1. Bad for read, good for writes.