Logical replication ਡੇਟਾ ਦੀਆਂ ਤਬਦੀਲੀਆਂ ਨੂੰ ਖਾਸ ਟੇਬਲਾਂ ਦੇ ਪੱਧਰ 'ਤੇ ਰੇਪਲਿਕੇਟ ਕਰਦਾ ਹੈ (publish/subscribe ਮਾਡਲ ਦੀ ਵਰਤੋਂ ਕਰਦੇ ਹੋਏ), ਨਾ ਕਿ ਪੂਰੇ ਡੇਟਾਬੇਸ ਕਲੱਸਟਰ ਨੂੰ byte-for-byte ਕਾਪੀ ਕਰਦਾ ਹੈ ਜਿਵੇਂ physical (streaming) replication ਕਰਦਾ ਹੈ। ਇਹ ਲਚਕਦਾਰ ਹੈ — ਚੋਣਵੇਂ, ਕ੍ਰਾਸ-ਵਰਜ਼ਨ, ਅਤੇ ਵੱਖ-ਵੱਖ ਸਕੀਮਾ ਲਈ — ਮਾਈਗ੍ਰੇਸ਼ਨ ਅਤੇ ਇੰਟਿਗ੍ਰੇਸ਼ਨ ਲਈ ਆਦਰਸ਼।
Logical ਬਨਾਮ 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.)
