1

Currently we are using postgres streaming replication to sync/replicate databases on Primary and replica server. We are planning to use one of the application to sync data from our secondary or replica server to our data warehouse which needs logical replication to be enabled for tracking the changes and syncing the data from our replica server to data warehouse. Can we enable logical replication on top of streaming replication ? Is it possible or good practice to enable both on the same server or database ? If so, will there be any performance impact or what are the considerations or best practices to be followed?

1 Answer 1

2

There is no problem with using streaming (physical) replication and logical replication at the same time, but a physical standby server cannot be a logical primary. So you will have to use the same server as primary server for both physical and logical replication. But that shouldn't be a problem, since streaming replication primary and standby are physically identical anyway.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for the response Laurenz Albe . Will there be any performance impact or any other special considerations to be taken if we are implementing both ?
That's a pretty general question. If you are wondering if the performance impact will be big, the answer is no.
Thanks Laurenz Albe. For setting up both streaming (physical) replication and logical replication at the same time on primary server , do we need to set wal_level = logical , wal_level = replica both at the same time or wal_level = logical , replica?
Setting wal_level to logical is the correct way, since that contains everything that replica does and more.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.