System Design Practice

1 Process

  • Be clear about functional (api) and non-function (quality) requirements.
  • Core entities
  • API or interface
  • Data flow
  • High-level design
  • Deep dives

2 Examples

Topic Description Design
Youtube
  • 100MB DAU
  • Support large size vedio uploading
  • Availabitiy >> Consitency
  • Low latency streaming
  • Scalibility

Core entities

  • Vedio
  • Vedio metadata
  • User

API

  • POST /vedios {Vedio, VedioMetadata}
  • GET /vedios/:veidoId
Screenshot 2026-07-05 at 3.58.33 PM

 

 Whatsapp

Functional requirements

  • group chats
  • send / receive messages
  • send / receive media
  • access messages after being offline
  • audio / vedio calling

 

Non-functional requirements

  • low latency < 500ms
  • guarantee delivery
  • billions of users
  • fault-tolerant

Core engities

  • user
  • chat 
  • message
  • client

Command sent

  • createChat
  • sendMessage
  • createAttachment
  • modifyParticipants

Command received

  • newMessage
  • chatUpdate
Screenshot 2026-07-25 at 9.10.22 PM

 

Ad click Aggregator

Non-functional requirements

  • idempotency of ad clicks (userId +  sessionAdId + Redis)

Screenshot 2026-08-31 at 3.40.28 PM

 

User

Functional requirements

  1. Users should input a start location and a destination
  2. request a ride
  3. Drivers should be able to accept / deny a request

Non-Functional requirements

  1. Low-latency
  2. Consistency 1-1 match
  3. Highly available
  4. handle high throughput

Core entities

  • Driver
  • Ride
  • Rider
  • Location

 

Screenshot 2026-10-12 at 2.59.22 PM

Consistency: Redis lock

Location: Geohash

Peak hours: Queue.

 

posted @ 2026-07-06 03:59  ylxn  阅读(13)  评论(0)    收藏  举报