Database is the most crucial component of IT systems. In order to achieve high availability of the applications using it, replication mechanisms have been developed.

Replication in EuroDB provides the capability to distribute physical copies of databases between different instances, data centres, and even continents. In addition, replication on the logical layer allows to use different data sources to create complex database structures.

EuroDB supports the majority of popular replication methods. Two of these methods are recommended by EuroDB for their capabilities and usefulness.

Streaming replication

  • Replication from a single master server to multiple slave servers
  • Synchronous and asynchronous replication
  • Ability to suspend data updates in a replica for a given time, in order to perform a long-running query on it (reports, backups, data migration to a warehouse, etc.). During this interval, data is already stored on the replica
  • Automatic introduction of changes in the data structure on slave servers
  • Automatic migration of all databases within the master instance
  • Ability to use the slave database in read-only mode
  • Ability to automatically switch database instances in the event of a master server failure (fail over)
  • Load balancing queries between master and slave instances (queries that retrieve data).

Example of EuroDB streaming replication

There is a Master server in the primary data centre, which is the main database server. Synchronous replication takes place between this server and the DR server. If there is no response from the Master server for more than 30 seconds, the DR server automatically switches to Master mode. Applications using the database use an intermediary server that is aware of the fact of switching. During the switching process, the HS servers (A and B) are automatically switched to use the DR instance as the new Master server.

Replication to HS servers is asynchronous. HS servers use less efficient resources, especially disk resources. Applications that use the EuroDB cluster knowingly use HS servers to perform resource-demanding, non-transactional queries.

Backup copy from HS servers is made during the backup window. With this implementation of EuroDB, copies are made independently in both data centres.

Performing a backup does not affect the performance of the Master server or the DR server in any way.

replikacja strumieniowa EuroDB

Logic replication

In cases of increased architecture complexity, EuroDB offers a more sophisticated mechanism – logical replication:

  • Grid replication – multiple master servers, multiple slave servers
  • Replication with granularity to a single table
  • Replication of specific DML types (or combinations thereof)
  • No DDL replication – protection of data structure in replicas
  • No automatic replication of newly created objects – higher level of security
  • Replication of individual databases within a cluster
  • Replicas in read/write mode – different conflict resolution mechanisms
  • Ability to modify the replication scope
  • Ability to use logical replication to update between major versions of EuroDB (rolling upgrade)
  • Logic replication is not based on trigger functions.

Example of the use of EuroDB logic replication

There is a master server in data centre A, from which all data is replicated to the DR server in data centre B. The replication engine has been configured to ignore the TRUNCATE type DML, ensuring data protection against accidental deletion. In addition, there is a read-only replica to which only the tables on which intensive readings take place are replicated. This optimizes disk space utilisation.

Thanks to the EuroDB mechanism for logical replication of INSERT type DML (without UPDATE, DELETE, TRUNCATE), a security instance is created in data centre C. It maintains a copy of all records that have been inserted into the TRANSACTIONS table, regardless of whether they have been changed or deleted in the production database.

The cascade replication takes place between the DR database and the read-only database in the data centre B on the same principles as in the data centre A.

There is a local EuroDB instance in the company’s branch where the production takes place. It is a partial replica of the Master instance from data centre A and a partial replica of the CRM Master database from data centre B. This database also has tables that are present in the local instance only.

replikacja logiczna EuroDB