TCapture is a new software for implementing data replication of Postgresql databases.
Supports PG-to-PG, log-based replication of DML, was introduced for PG v>9.4 and currently is available on Linux.
The big advantage of TCapture is that is based on PostgreSQL’s logical decoding, providing efficient, fast and consistent database replication for clusters.
It capture transactions for replication from Write-Ahead Logs (WAL) instead of using triggers, eliminating overhead on master databases
and is designed to be as transparent as possible to the client, stable and secure by default.
Attraction of TCapture
One of the attractions of TCapture is that it’s quite easy to set up and configure: starting from scratch,
you can deploy a working replication system (albeit with very simple primary and replicate tables configuration) in less than 30 minutes.
The setup procedure is described quite well in the User’s Guide (see documentation page).
As always with replication, make sure you have a clear idea of the replication logic you want to implement before you start (see multimaster considerations page).
The primary use of TCapture is to build distribute clusters in Multi Master or Master-Slave configuration.
Furthermore, due to the flexible architecture of TCapture it is easily possible to extend or adjust the replication process to many different means.
In a nutshell
The actual TCapture engine is a Java application which runs as a separate program outside Postgres, and which must be started explicitly.
When TCapture is running, it will scan the transaction log of all primary databases and pick up transactions which must be replicated.
Transactions which have been picked up are stored in the “Replication Database”, a PG user database exclusively used by TCapture.
In the Replication Database, transaction is ‘copied’ to all replicate databases which have a subscription for this transaction. Transaction is then applied to the replicate tables by inserting it into by the dedicated Java application module
Efficient, fast and consistent
Considering its asynchronous mesh architecture, TCapture handles writing transactions quite well.
Thanks to its tight integration into the database system and its transaction serializing mechanism, TCapture
provide efficient, fast and consistent database replication.
T-Capture is very new, and there isn’t much performance-related information from practical applications yet.
This performance test should not be seen as a full-blown benchmark, but only as a rough indication of the relative capabilities of the product:
The setup was as follows: PostgreSQL servers hosted in virtual data centers located in Milan, New York, London and HongKong. On each a primary databases were created, each containing the same tables. These tables were then replicated in a multi master solution, each primary node replicate on the other three slave databases. The maximum sustained throughput was then measured for each of these replication systems (during which the other replication system was shut down). The results: with TCapture, a maximum of 500 transactions per second (end to end) could be replicated before latency started to increase.