Skip to main content
InterviewHubPRO
Section Overview
Q20

Question 20 of 50

Part 2: Core Architecture & Implementation (Mid-Level)

40%
PostgreSQL Enterprise (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)

What is the difference between Physical Streaming Replication and Logical Replication?

senior LevelSystem Design

In Simple Words:

  • Physical Streaming Replication: Replicates exact, bit-for-bit byte blocks from WAL files.
    • Replicates the entire database cluster. Secondary must be read-only and run the exact same PostgreSQL major version and OS architecture.
  • Logical Replication (Publish/Subscribe): Replicates logical data modifications (inserts, updates, deletes) via logical decoding plugins (pgoutput):
    • Can replicate individual tables or schemas.
    • Replicas can have additional indexes, writeable local tables, and run different PostgreSQL major versions (enabling zero-downtime major version upgrades!).