Data Transfer between PostgreSQL Databases

Just a quick question: what would be the most efficient way to transfer data (say: a table) between 2 PostgreSQL databases both hosted on Aiven? Transfer should happen on a regular basis, automated.

Thanks,
Stephan

Hi Stephan!
I would say that there are two ways to achieve the goal of transferring the data between 2 PG instances:

The former is simpler since it requires only PG and a couple of extensions but has the drawback of classic batch oriented replication. The latter has the benefit of providing updates in near real time via change data capture using PostgreSQL WAL logs.

One efficient way to transfer data between two PostgreSQL databases hosted on Aiven is to use the built-in replication features like Logical or Streaming Replication. Set up replication between the source and destination databases, ensuring real-time or selective data transfer based on your requirements. Automate the data transfer process using cron jobs or a scheduler service, triggering a script that extracts data from the source and inserts it into the destination database.

Best Regard
Danish Hafeez | QA Assistant
ICTInnovations