Complete guide for setting up real-time logical replication between PostgreSQL/EDB instances
Helyx is a lightweight, high-performance replication solution designed for real-time heterogeneous database replication. It provides a simple CLI-driven experience and abstracts the complexity of setting up connectors, schema registry, and replication pipelines.
With Helyx, enterprises can achieve enterprise-grade replication with lower operational overhead, faster setup, and proven reliability compared to traditional tools.
Helyx is distributed as an RPM package to simplify installation and management. By default, Helyx is installed in the directory /var/lib/helyx.
This section describes the steps to install Helyx from a standard YUM/DNF repository as well as from a local repository if you download the RPM manually.
Create Local Repository Directory:
mkdir -p /opt/localrepo/helyx cp helyx-1.1.0.rpm /opt/localrepo/helyx/
Create Repository Metadata:
cd /opt/localrepo/helyx createrepo .
Add Local Repository Entry (create /etc/yum.repos.d/helyx-local.repo):
[helyx-local] name=Helyx Local Repository baseurl=file:///opt/localrepo/helyx enabled=1 gpgcheck=0
Install from Local Repository:
sudo yum install helyx -y
Post installation verifies and ensures binaries are installed under /var/lib/helyx location.
Target: Set up real-time replication between PostgreSQL/EDB source and destination with different versions as well as same version.
/var/lib/helyx/replconfig βββ publication.config βββ subscription.config βββ tablelist.config βββ tabletorepl βββ serverconfig βββ configservice
Ensure these services are configured and started:
./configservice -start sync-manager
Edit /var/lib/helyx/ server.properties and set:
listeners = PLAINTEXT://your.host.name:9092
your.host.name will be the IP address of the server where Helyx is running.
Now start broker service:
./configservice -start broker
Edit /var/lib/helyx/plugins/confluent-7.5.0/etc/schema-registry/schema-registry.properties and ensure:
kafkastore.bootstrap.servers=PLAINTEXT://<your.host.name>:9092 listeners=http://0.0.0.0:8081
your.host.name will be the IP address of the server where Helyx is running.
./configservice -start schemaregistry
Edit /var/lib/helyx/config/connect-distributed.properties and set:
bootstrap.servers=<your.server.ip>:9092 key.converter.schema.registry.url=http://<your.server.ip>:8081 value.converter.schema.registry.url=http://<your.server.ip>:8081
./connectservice -start connect
In order for Helyx to perform replication, a dedicated database user with appropriate privileges must be created. This section describes the SQL commands required to create the helyx role, schema, and associated privileges on the source database.
CREATE ROLE helyx WITH LOGIN REPLICATION PASSWORD 'password';
CREATE SCHEMA IF NOT EXISTS helyx;
GRANT CONNECT ON DATABASE edb TO helyx; GRANT CREATE ON DATABASE edb TO helyx;
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA helyx TO helyx; ALTER DEFAULT PRIVILEGES IN SCHEMA helyx GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO helyx;
Edit /var/lib/helyx/replconfig/publication.config with the following keys:
"name": "", // Unique identifier "tasks.max": "1", // Parallelism level "database.type": "edb", // edb or postgresql "database.hostname": "", // Source DB IP "database.port": "5444", // Source DB Port "database.password": "", // Source DB βhelyxβ user password "database.dbname": "edb", // Database name "bootstrap.ip": "", // Broker Server IP "include.schema.list": "schema1,schema2,schema3", "schema.history.internal.kafka.bootstrap.servers": "<serverIP>:9092", "publication.name": "", // Logical replication publication name "snapshot.mode": "initial", "database.history.kafka.bootstrap.servers": "<serverIP>:9092", "database.history.kafka.topic": "dbhistory.<Topicname>", "topic.prefix": "", // Prefix for Replication topics "max.batch.size": "2048", "max.queue.size": 50000, "poll.interval.ms": "1000", "producer.batch.size": "32768", "producer.max.request.size": "10485760"
Enter comma-separated table list at /var/lib/helyx/replconfig/tablelist.config. These are the tables you want to replicate.
Schema1.Table1, Schema2.Table2, Schema2.Table3
Then run:
./tabletorepl.jar -s <path_to_publication.config> -tables <path_to_tablelist.config>
For command help: ./tabletorepl.jar -help
In order for Helyx to perform replication, a dedicated database user with appropriate privileges must be created. This section describes the SQL commands required to create the helyx role, schema, and associated privileges on the destination database.
CREATE ROLE helyx WITH LOGIN REPLICATION PASSWORD 'password'; ALTER ROLE helyx WITH REPLICATION;
CREATE SCHEMA IF NOT EXISTS helyx AUTHORIZATION helyx;
GRANT CONNECT ON DATABASE edb TO helyx; GRANT CREATE ON DATABASE edb TO helyx;
For schemas listed in include.schema.list of the publication config, grant:
GRANT USAGE ON SCHEMA <schema_name> TO helyx; GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA <schema_name> TO helyx; GRANT CREATE ON SCHEMA <schema_name> TO helyx; ALTER SCHEMA <schema_name> OWNER TO helyx; ALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name> GRANT ALL ON TABLES TO helyx; ALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name> GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO helyx;
Note: username will be same at source and destination with the same password.
Edit /var/lib/helyx/replconfig/subscription.config with:
"name": "", // Unique identifier name "tasks.max": "1", "connection.url": "jdbc:postgresql://<Dest_ServerIP>:5444/edb?user=helyx&password=<password>", "bootstrap.ip": "", // Kafka IP "retry.backoff.ms": "1000", "consumer.max.poll.records": "1000", "consumer.fetch.max.bytes": "10485760", "batch.size": "5000", "max.retries": "10"
Note: User name helyx will NOT be changed
Common usages of serverconfig:
| Action | Command | Copy |
|---|---|---|
| Create publication | serverconfig -createpub -s publication.config -tables tablelist.config | |
| Create subscription | serverconfig -createsub -s subscription.config -pub publication.config | |
| Add tables to publication | serverconfig -addtabletopub -s publication.config -tables tablelist.config | |
| Trigger ad-hoc snapshot | serverconfig -adhocsnapshot -s publication.config -tables table1,table2 | |
| Monitor publication status | serverconfig -status -pub -s publication.config | |
| Monitor subscription status | serverconfig -status -sub -s subscription.config | |
| Remove publication | serverconfig -remove -pub -s publication.config | |
| Remove subscription | serverconfig -remove -sub -s subscription.config | |
| Remove table from replication | serverconfig -removetablefromrepl -s publication.config -tables table1,table2 | |
| Encrypt password | serverconfig -encryptPassword -s publication.config | |
| List connectors | serverconfig -listconnectors -s publication.config | |
| List tasks | serverconfig -listtask -s publication.config | |
| Lag statistics | serverconfig -lagstat -s subscription.config | |
| List replicated tables | serverconfig -tablelist -s publication.config |
On destination DB, execute:
CREATE ROLE helyx WITH LOGIN PASSWORD '<password>'; ALTER ROLE helyx WITH REPLICATION; GRANT CREATE ON DATABASE <Database Name> TO helyx; CREATE SCHEMA IF NOT EXISTS helyx AUTHORIZATION helyx; GRANT USAGE ON SCHEMA <schema_name> TO helyx; GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA <schema_name> TO helyx; GRANT CREATE ON SCHEMA <schema_name> TO helyx; ALTER SCHEMA <schema_name> OWNER TO helyx; ALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name> GRANT ALL ON TABLES TO helyx; ALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name> GRANT USAGE ON SEQUENCES TO helyx; ALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name> GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO helyx;
Note: Please note that username will be same as source and destination database with same password.
serverconfig -createpub -s publication.config -tables tablelist.config serverconfig -createsub -s subscription.config -pub publication.config serverconfig -addtabletopub -s publication.config -tables tablelist.config serverconfig -adhocsnapshot -s publication.config -tables table1,table2 serverconfig -status -pub -s publication.config serverconfig -status -sub -s subscription.config serverconfig -remove -pub -s publication.config serverconfig -remove -sub -s subscription.config serverconfig -removetablefromrepl -s publication.config -tables table1,table2 serverconfig -encryptPassword -s publication.config serverconfig -listconnectors -s publication.config serverconfig -listtask -s publication.config serverconfig -lagstat -s subscription.config serverconfig -tablelist -s publication.config
βΆ Start the Publication
serverconfig -createpub -s publication.config -tables tablelist.config
βΆ Start the Subscription
serverconfig -createsub -s subscription.config -pub publication.config
βΆ Monitor Status
serverconfig -status -pub -s publication.config serverconfig -status -sub -s subscription.config
If you want to add a new column to a table that is already being replicated, follow these steps carefully:
To safely add a new column to an existing replicated table and synchronize the schema with downstream systems.
1) Stop the Connect Worker service:
systemctl stop connect.service
This ensures that no replication occurs during the schema update.
2) Add the column in the source database:
ALTER TABLE <schema>.<table_name> ADD COLUMN <new_column_name> <datatype>;
3) Start the Connect Worker service:
systemctl start connect.service
The connector will reload the schema change and start applying changes again.
4) Trigger an ad-hoc snapshot for the updated table:
serverconfig -adhocsnapshot -s publication.config -tables <table_name>
This ensures the new column is picked up and replicated to the destination database.
tail -f /var/lib/helyx/logs/connect.log
Visit: http://<schema-registry>:8081/subjects
serverconfig -lagstat -s subscription.config
serverconfig -help
Note: Always test on a staging environment before applying to production.
Happy Replication! π