Scaling

Leader–Follower

Description

Ideally suited for read-heavy workloads. One node (Leader) handles writes, others (Followers) replicate data and handle reads.

Where to use

  • Databases (Postgres, MySQL).

Real World Example

Primary DB accepts writes, replicas serve read traffic.

Code Example

class Leader–Follower:\n    def __init__(self):\n        pass\n\n    def execute(self):\n        print('Executing Leader–Follower')