This repository contains notes, diagrams, and code snippets created while learning system design concepts. It's intended as a personal reference for revision and interview preparation. Topics include high-level design patterns, scalability principles, common system architectures, and more.
- System Design
- Databases
- Consistency in Distributed Systems
- Caches
- Networks
- Data Replication and Migration
- Security in Distributed Systems
- Observability in Distributed Systems
- Distributed Consensus
- Rate Limiting
- Tradeoffs
- Email Service
- Tinder Design - Recommendation
- Whatsapp Design - Chat Application
- Google Docs - Collaborative Editor Design
- Uber - Cab Aggregator App
- Workflow Management and Recommendation
- Whatsapp Calling
A collection of materials referred to while learning:
- System Design Course by Gaurav Sen
- System Design Primer
- System Desin Interview - Alex Xu (Part 1)
- Browse by topic directories or use the table of contents above.
- Diagrams are stored under
/diagrams
and topic-specific folders. - Use markdown files as revision notes before interviews.
- Refer to example architectures for designing systems in projects.
This is a personal learning repo, but feel free to open issues or PRs if you spot something helpful to add.
In a distributed computer system, you can only support two of the following guarantees:
Consistency
- Every read receives the most recent write or an error (All nodes see the same data at the same time.)Availability
- Every request receives a response, without guarantee that it contains the most recent version of the information (The system is always responsive.)Partition Tolerance
- The system continues to operate despite network failures or delays. (No data loss or crash due to communication break between nodes.)
Networks aren't reliable, so you'll need to support partition tolerance. A distributed system must be partition-tolerant (P). So, a practical tradeoff is between Consistency (C) and Availability (A).
- Waiting for a response from the partitioned node might result in a timeout error.
- CP is a good choice if your business needs require atomic reads and writes.
- Banking systems prefer CP
- Responses return the most readily available version of the data available on any node, which might not be the latest.
- Writes might take some time to propagate when the partition is resolved.
- social media feeds prefer AP.
ACID is a set of properties that ensure reliable, consistent, and safe transactions in a database system.
Property | Ensures... | Example | Use Case |
---|---|---|---|
Atomicity | All or none execution | Debit fails → entire txn rolled back | Bank transfers |
Consistency | Valid state transitions | No violation of constraints | E-commerce inventory updates |
Isolation | No interference between transactions | Prevents dirty reads/race conditions | Online booking systems |
Durability | Changes survive system failures | Data saved after commit | Order confirmations in retail apps |
Consistent Hashing maps servers to the key space and assigns requests(mapped to relevant buckets, called load) to the next clockwise server. Servers can then store relevant request data in them while allowing the system flexibility and scalability.
FFmpeg is a powerful, free, and open-source multimedia framework used for decoding, encoding, transcoding, and streaming audio and video files.
AVI, or Audio Video Interleave, is a multimedia container format developed by Microsoft to store both audio and video data in a single file, allowing for synchronized playback.
Homebrew is a package manager for macOS (and Linux) that simplifies the installation, updating, and management of software on your system.
- HLS, or HTTP Live Streaming, is a widely used video streaming protocol developed by Apple that delivers audio and video content over the internet.
- It's known for its adaptability to changing network conditions, reliability, and compatibility with various devices and browsers.
- HLS works by breaking down video files into smaller segments, which are then downloaded and played sequentially by a video player.
- Dynamic Adaptive Streaming over HTTP (DASH) is a streaming technology that adapts video quality in real-time based on network conditions, delivering high-quality video over the internet using standard HTTP servers.
- It achieves this by breaking down video content into segments, each with varying bitrates, and allowing the client device to dynamically select the most appropriate segment for the current network bandwidth
- Traditional circuit-switched telephone network.
- Requires telephone lines and dedicated bandwidth per call.
- Cost depends on distance and duration.
- Generally reliable but expensive.
- Example: Landline phone systems.
- Transmits voice calls over the internet using packet-switching.
- Requires only internet connectivity (no phone lines).
- Cost-effective and often free.
- Scalable and flexible, but quality depends on internet speed.
- Example: Skype, Zoom, WhatsApp calls.
- Signaling protocol used to establish, manage, and terminate VoIP calls.
- Handles call setup, teardown, and modifications.
- Works with other protocols (e.g., RTP for media transmission).
- Used for voice, video, and messaging sessions over IP.
- Example: Used in VoIP softphones and enterprise telephony systems.