Skip to content
Features

Logical Replication 

Logical replication in CrateDB is a method of data replication across multiple clusters based on the publish-subscribe model. The publisher, a database instance, makes data available through publications, which contain tables available for replication. Subscribers can pull data from the publications of the publisher, and replicated tables on a subscriber can be published further to other clusters, allowing for chaining subscriptions. A cluster can have both publications and subscriptions.

In addition to data, all types of operations, including INSERT, DELETE, UPDATE, and schema changes, are also replicated. With logical replication, you can replicate only a selection of data to specific locations without the need to duplicate all the data.

CREATE PUBLICATION NAME
{ FOR TABLE table_name [, ...] | FOR ALL TABLES
}
CREATE SUBSCRIPTION NAME
CONNECTION ‘path_to_publisher’
PUBLICATION publication_name [, ...]
[ WITH (parameter_name [= value], [, ...], ...)
CrateDB-Logical-Replication

Benefits of logical replication

  • Collecting data close to the source (Edge) and replicating only specific data to a central cluster
  • Synchronizing data from multiple sources into one single location
  • Ensuring data recovery in case of cluster failure

Use cases for logical replication

  • Centralized reporting, which replicates data from multiple geographically distant clusters back to a centralized reporting cluster. 
    centralized_reporting
  • Data locality optimization by replication of data from a large cluster to a large number of smaller localized clusters for low latency access. 
    data_locality
  • Disaster recovery.
  • Replication between different compatible versions of CrateDB.

On-demand webinar

How to leverage CrateDB 4.8 to its full potential.

 Timestamp: 17:38 – 24:16

[Version 4.8 is when logical replication got introduced]

 

Additional resources

Interested to learn more?