Scaling, Caches, LBs Flashcards
Key characteristics of distributed systems
scalability
reliability
availability
efficiency
manageability
Scalability
the capability of a system, process or network to grow and manage increased demand
Horizontal Scaling
Scale up by adding more servers to your pool of resources
Vertical Scaling
Scale up by adding more power (CPU, RAM, Storage) to an existing server
vertical scaling is usually limited to the capacity of a single server
Reliability
Reliability refers to a system’s ability to perform it’s intend functions correctly and consistently
Reliability can be achieved through redundancy
Redundancy
the intentional duplication of critical components or functions of a system with the goal of increasing reliability and eliminating singles points of failure
Database Replication
Database replication is the process of copying and synchronizing data from one database to one or more additional databases.
This is common in distributed systems
ensures data availability, fault tolerance, and scalability.
Synchronous Replication
with synchronous replication, changes made to the primary database are immediately replicated to the replica databases before the write operation is considered complete
this ensures strong consistency between the database and its replicas
Asynchronous Replication
a type of database replication where changes made to the primary database are not immediately replicated to the replicas
Instead, changes are queued and replicated to the replicas at a later time.
PROS - Faster Performance, and writes won’t fail bc of issues with the replica
CONS - This delay can result in temporary inconsistencies between the primary and replica databases
Availability
A measure of the percentage of the time that a system, service or machine remains operational under normal conditions
Reliability vs. Availability
A system is RELIABLE if it’s able to function correctly
A system is AVAILABLE depending on the % of the time that it is operational under normal conditions
Good reliability translates to good availability
But availability does not indicate reliability
You can have high availability on an unreliable product by minimizing repair times and ensuring that replicas are always ready
Efficiency
Efficiency of a system is measured through latency and throughput
Latency
The time it takes for a certain operation to complete in a system
Throughput
The number of operations that a system can handle properly per time unit. Commonly measured in RPS (requests per second)