top | item 35204977

(no title)

boromisp | 3 years ago

PostgreSQL logical replication only cares about the data. It doesn't require that you have the same database schema - or even a database - on the receiving end. It doesn't know about stored procedures.

You would typically use it for situations where you don't want to replicate your whole database.

You can subscribe to a narrow/specific set of changes (for example if you only care about inserts to a specific table, no other changes).

It has some significant limitations that means, it can't really be used as "Kafka Streams lite":

You can't have different permissions for different publications. If a subscriber can read one, it can read them all.

There is no separate storage for the publications or the subscribers: if any subscriber is slow/stuck/offline, it will hold back all your WAL for the entire database cluster.

--

If you want an exact replica of your database, you have to use the "physical replication". This still doesn't specifically care about stored procedures, but it replicates data and schema change exactly.

discuss

order

No comments yet.