Skip to content

Commit

Permalink
Update system design note.
Browse files Browse the repository at this point in the history
  • Loading branch information
anonyknight committed Jan 8, 2024
1 parent 76a9e93 commit 2ce00ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Publish records to Kafka

### Consumers

Subcriber of kafka topics.
Subscriber of kafka topics.

### High Level Architecture

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
---
title: TinyURL
date: 'January 29, 2022'
tags: ['System-Design']
---

# TinyURL

[System Design : Scalable URL shortener service like TinyURL](https://medium.com/@sandeep4.verma/system-design-scalable-url-shortener-service-like-tinyurl-106f30f23a82)

URL shortening is used to create shorter aliases for long URLs.

## Requirements
Expand All @@ -23,10 +26,10 @@ URL shortening is used to create shorter aliases for long URLs.

### Extended requirements

* Telemetrics: how many times a reduction happened?
* Telemetry: how many times a reduction happened?
* REST APIs by other service.

## Capacity Estimation and constriants
## Capacity Estimation and constraints

**Read-heavy service**: R:W = 100:1

Expand All @@ -44,7 +47,7 @@ URL shortening is used to create shorter aliases for long URLs.

**Read**: 20K URL/S

### Storate
### Storage

Store URL in 2 years:

Expand Down Expand Up @@ -130,13 +133,13 @@ No relationship between objects. No-SQL for availability and horizontal scalabi

How to generate a short and unique key for a given URL?

### Encoidng actual URL
### Encoding actual URL

[MD5](https://en.wikipedia.org/wiki/MD5) or [SHA256](https://en.wikipedia.org/wiki/SHA-2)

[Base64](https://en.wikipedia.org/wiki/Base64#Base64_table) with 6 letters long. 64^6 = 68.7 Billion

MD5sum to generate hash. 128 bits.
MD5Sum to generate hash. 128 bits.

#### How to resolve hash collision?

Expand Down

0 comments on commit 2ce00ca

Please sign in to comment.