Posts

Showing posts with the label high availability

Distribution System Practice Series

Image
Introduction A distribution system is a collection of independent computers in terms of hardware but communicating and coordinating with each other through a computer network, making end users feel like a single centralized system. In the era of big data and cloud computing, distributed architecture plays a backbone role for almost all large-scale online services. Core Characteristics For a system to be considered truly distributed, it must face and solve the following technical characteristics: No Shared Clock : Each node has its own physical clock and there is always a certain clock drift. Therefore, you cannot rely on absolute real time to determine the order of events happening between nodes. No Shared Memory : Nodes cannot directly read or write to each other's RAM. Every communication activity and state synchronization must be done through message passing such as protocols like HTTP/REST, gRPC or message brokers like Kafka, RabbitMQ. Concurrency : Multiple nodes process indep...

Implement Replication with Patroni, etcd and Haproxy

Image
Introduction Database replication is the process of automatically copying and synchronizing data from one database server (called Master or Primary ) to one or more other servers (called Slave , Standby or Replica ). Thus, the way it works is when there are data modification operations on the Master , the changes will be executed equivalently on the Slave . Advantages If you only run a single Database node, you will face many risks that Replication can resolve as follows: High Availability (HA) : If the Master node suffers a hardware failure or power outage, an active Slave node will immediately be elected as the new Master , which is the Failover mechanism helping the system continue running without disruption. Read Scalability : Data writing queries ( INSERT, UPDATE, DELETE ) must be sent to the Master. But reading queries ( SELECT ), which account for most of the system load demand, can be evenly distributed among the Slaves for processing. Disaster Recovery : You can place ...