System Design Flashcards
ACID
ACID:
- Atomicity
- Consistency
- Isolation
- Durability
(traditional RDBMS)
ACID vs. BASE
- ACID ensures strong consistency.
- BASE favors availability and partition tolerance.
BASE
BASE:
- Basically Available
- Soft state
- Eventual consistency
(NoSQL)
ACID applies to ___ DBMS
Traditional Relational
BASE applies to ___ DB
NoSQL
Microservice
Microservices: small, independently deployable services.
Monolith
Monolith: single deployable artifact with all functionality.
Microservices vs. Monolith
Microservices scale independently but add complexity in communication and deployment
REST
REST: resource-based, typically over HTTP with JSON.
RPC
RPC: direct function calls (e.g., gRPC) often with protocol buffers.
REST vs. RPC
- REST is simpler, more flexible.
- RPC can be more efficient and strongly typed.
CAP Theorem
Definition:
In a distributed system, you can guarantee ONLY TWO of:
- Consistency
- Availability
- Partition Tolerance
If a network is partitioned, systems choose to be CP (consistent, not fully available) or AP (available, not fully consistent).
AP systems are ___ but not ___ (Partitioned network)
AP systems are AVAILABLE but not fully CONSISTENT
CP systems are ___ but not ___ (Partitioned network)
CP systems are CONSISTENT but not fully AVAILABLE
Scaling - Horizontal
Horizontal: adding more machines