Logical replication mereplikasi perubahan data di tingkat tabel tertentu (menggunakan model publish/subscribe), bukan menyalin seluruh database cluster byte-for-byte seperti physical (streaming) replication. Ini membuatnya fleksibel — selektif, lintas versi, dan ke skema berbeda — ideal untuk migrasi dan integrasi.
Logical vs physical replication
PHYSICAL (streaming) → replicates the ENTIRE cluster at the storage/WAL level
✓ exact copy, simple ✗ all-or-nothing, same Postgres version, read-only replica
LOGICAL → replicates specific TABLES' changes via a publish/subscribe model
✓ SELECTIVE (choose tables), CROSS-VERSION, to DIFFERENT schemas, replica is WRITABLE
✗ more setup, some limitations (DDL not replicated automatically, etc.)
