Posts

Showing posts from December, 2020

NETFLIX HIGH-LEVEL SYSTEM DESIGN

Image
  STEP - 1 Functional Req   User Registration + login + profiles Search Recommendations Activity tracking Recommendation generation Dashboard Payment Content Ingestion and Delivery Rights + Licences Categorization Notifications Trend Movies Watch History Endorsement Design Constraints Number of users: 100 million Daily active user: %10 Content Upload / sec: Minimal Content Streamed / sec: Need scaling  How many videos let’s say 20000 Averaga per video 10 GB : 3gb HD + 1gb sd = 4 gb.  Avg per video 2,5 hours = 10 GB Content Size: the average size of the video data User activity tracking: High Content streaming latency STEP - 2  Define Microservices We can bucketize functional requirements into Microservices.   The system is a huge system so should be a lot of teams to handle these requirements.  Multiple Microservices - Breadth Oriented System. High Priority Microservices  Microservices  Technology Type User activity tracking MS Simple time-series K-V workload with TTL/count Recommendat

URL Shortener System Design

Image
STEP 1  Functional Req. Given a Long URL, generate a unique short URL. Given a short URL, redirect to a long URL Customized URL,(User should be able to pick a custom short link) TTL (User should be able to specify the expiration time) Non-Functional Req. The system should be highly available. With min latency Non-predictable Analytics Design Constraint Generated per second Length of the short URL,  Let’s start with 7 Char set in the short URL; A-Z, a-z, 0-9 STEP - 2 Microservice Design Decision URL Shortener Microservices All requirements can handle the same team A single microservice - A depth-oriented problem STEP - 3 Drawing logic architecture STEP - 4A  TIERS Default we can multiple every tier 3X  App server tier, In-memory Tier, Storage Tier Data Model Short URL/unique ID, Long URL, TTL, creation time K: Short URL/unique id,  V: Rest of the stuff APIs create(Long URL) -> create(V) read(short URL) -> read(K) Similar to CRUD APIs create (K,V), read(K), update(K,V), delete(K)