If you must care about bit-level accurate replication, catching gaps after the replication completes is we concluded after a year of chasing that chimera a deep rabbit hole with an event horizon that constantly recedes into the future. If you can tolerate some replication errors and can tolerate not knowing where they happen without a lot of investigation, then CDC works great.
CDC gets us close, but I'm still looking for someone who is working upon covering the edge cases that redo logs alone do not address.
https://hexdocs.pm/postgrex/Postgrex.ReplicationConnection.h...
Here's a great talk on Postgrex Relication:
Yeah I was gonna say, there are probably ways to use the PostgreSQL Write-Ahead Log (WAL) to stay up to date with every change, without having triggers. This CDC you mention sounds similar to that.
You should use embedded mode if you do not require fault-tolerance and can miss updates. Otherwise, don't. Regardless of scale.
CDC is such a great concept and is so little used unfortunately
One other benefit is they capture all the changes to the underlying data, not just the net changes.
It’s important to realize though that CDC records change information but isn’t a mechanism to move it anywhere. You would still have to devise a means to move the data to another system.
Debezium is a data movement tool that uses CDC for the underlying tracking.