How does asynchronous replication work in databases

Replication

Replication is a method of data backup in which the same data is copied from a primary storage medium to one or more secondary storage media.


The process of replication is also used for data synchronization in distributed databases and ensures that all database tables are identical. The distributed databases are compared regularly or online with the original database. This ensures data consistency between the distributed databases. The replication process is used for transactions, which means that the databases have the same data.

When it comes to replication, a distinction is made between synchronous, asynchronous and bidirectional replication. With synchronous replication, changes to the data in the primary storage are copied to all secondary storage at the same time. As a result, all memories, the primary and the secondary, have current and identical data stocks at all times. The synchronous data exchange can take place via storage networks (SAN), local networks (LAN) or wide area networks (WAN). The synchronous method is limited to distances of a few hundred kilometers, as the runtimes lead to high latencies.

It is different with asynchronous replication. With this technique, the data in the primary storage is updated and stored first, and the data in the backups is only updated after a certain latency period. The files can be transferred using the FTP protocol or the SSH protocol.

Bidirectional replication is about the replication of data between primary storage and backup, whereby the functions of the storage media are interchangeable and the data can be exchanged in both directions between the storage media. In bidirectional replication, primary storage and backup storage have interchangeable roles. In contrast, with unidirectional replication, the functions of the storage media are permanently assigned. One storage medium is primary storage, another is backup storage. The data can only be transferred from the primary storage to the backup storage.