System Design 101: Scalability, Availability, and Reliability
System design is the process of defining the architecture, interfaces, and data for a system to satisfy specified requirements.
Scalability
Scalability is the property of a system to handle a growing amount of work by adding resources to the system.
- Vertical Scaling (Scaling Up): Adding more power (CPU, RAM) to an existing machine.
- Horizontal Scaling (Scaling Out): Adding more machines to the pool of resources.
Load Balancing
A Load Balancer distributes incoming network traffic across a group of backend servers. This ensures no single server bears too much load.
Database Scaling
- Replication: Creating copies of your database. Master-Slave architecture is common where writes go to Master and reads go to Slaves.
- Sharding: Partitioning your data across multiple databases.
Caching
Caching is a technique that stores a copy of a given resource and serves it back when requested. Common caching layers include Redis or Memcached. Caching improves latency and reduces the load on your database.
CAP Theorem
The CAP theorem states that a distributed data store can only provide two of the following three guarantees:
- Consistency: Every read receives the most recent write or an error.
- Availability: Every request receives a (non-error) response, without the guarantee that it contains the most recent write.
- Partition Tolerance: The system continues to operate despite an arbitrary number of messages being dropped by the network between nodes.
Understanding these trade-offs is key to building robust distributed systems.
Comments
Sign in to join the conversation