Chapter 3: Pastebin Flashcards

1
Q

Requirements

A
Functional
1. Users should be able to upload or paste their data and get a unique URL. 
2. Only text data
3. Liks will have a expiry date.
4. Custom alias
Non Functional
1. Highly reliable
2. Highlt Available
3. Realtime with low latency
4. Links should not be guessable.
Extended:
1. Analytics
2. Rest api service.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Design Considerations

A
  1. 10 MB paste limit

2. URL size limit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Capacity estimation

A
  1. One million pastes per day.
  2. Approx 12 pastes per second
  3. Approx 60 reads per second
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Storage estimation

A
  1. 1M * 10kb per day == 10GB per day
  2. For 10 years, it will be 36 TB
  3. At 70 percent capacity, we need 50TB.
  4. Ingress -> 10 KB * 12 == 120KB
  5. Egress -> 10 KB * 60 == 600KB
  6. Cache for 20% == 10GB
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

API

A

addPaste(key, data, custom_url, user, paste, expiry_date)

deletePaste(key, url)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

HLD

A

I would use a key value store with consistent hashing. He has written two databases, one for metadata and one for pastes, but I don’t think it is good.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Application Layer

A
  1. Key generation

2. Duplicates and collision

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Datastore Layer

A
  1. Key value store
  2. Cleanup
  3. Partitioning
  4. Cache and Load Balancer
  5. Security and Permissions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly