AlgoViz

PostgreSQL

medium 32 min

PostgreSQL is an open-source relational database that never overwrites a row: every change adds a new version, readers pick the version their snapshot may see, and vacuum clears away versions nobody needs.

What each level should show

The same question is judged differently for mid, senior and staff.

  • Mid

    Must show

    • Explains transactions, indexes and MVCC
    • Knows the default isolation level
    • Uses a pool

    Will be probed on

    • B-tree or GIN
    • What EXPLAIN shows

    Stands out

    Says why an update makes work for vacuum.

  • Senior

    Must show

    • Chooses synchronous or asynchronous per need
    • Designs failover with one leader
    • Scales in the right order

    Will be probed on

    • Replica lag and own writes
    • PgBouncer limits
    • Online index builds

    Stands out

    Names the metric that triggers each next step.

  • Staff

    Must show

    • Plans for wraparound, bloat and upgrades
    • Compares with MySQL, document and distributed SQL
    • Chooses what not to put in it

    Will be probed on

    • Sharding key and migration
    • Recovery time and loss targets
    • Cost of keeping slots and WAL

    Stands out

    Explains the failure modes of the replication choice.