Canhua's Blog
  • Blogs
  • My GitHub Projects
  • Profile
  • Linkedin
Canhua's Blog

System Design Interview

May 21, 2022

Requirement

  1. Post, Delete, Search, Image&Video, Comment, Like
  2. CAP (Strong, Weak, or complete consistency, High Availability 99.999
  3. Latency 95% returns 2 seconds
  4. Read heavy, Write Heavy, and Read/Write ratio
  5. Scalability, Security, Monitor, Log, Failover

Estimation

Storage, request/second

High Level Design

Rep-Federation-Shard
Slave
Master
User
Web Server
Write API Async
Object Store
Write API
Read API
CDN
LB
DNS
Cache
Queue
Worker
NoSQL

Component Design

DB Schema

API

Bottlenecks

  1. Load Balance, Data Sharding, In Memory DB
  2. Scale: Vertical/Horizatal, Cache(Application, DB Caching, In Memory), LB, DB rep, DB partition, Map-Reduce

Profile picture

Written by Canhua Li Experienced Full Stack Engineer at Microsoft, proficient in C++, C#, JavaScript, React, AngularJS, Ruby & Rails, and .Net.

  • ← Trie, Heap and Binary Index Tree
  • Create an ASP.NET Core app with React + Typescript in Visual Studio →
© 2023, Built with Gatsby