10 minutes / published

Testcontainers: Proving Invariants Against the Databases You Actually Deploy

Why the course opens an Oracle lane and keeps no-overlap true with different database mechanisms.

H2 Is Not The Contract

The Palabas course is built around database-owned invariants. A lightweight substitute can be useful for small unit tests, but it cannot prove Postgres exclusion constraints or Oracle row-lock behavior.

That is why Phase 3 moves the important suite to Testcontainers and real database images.

Same Invariant, Different Mechanism

Postgres rejects overlapping showtimes with a GiST exclusion constraint. Oracle uses a screen-row mutex trigger with SELECT FOR UPDATE.

The domain rule does not change: two concurrent attempts cannot create overlapping occupancy windows on one screen.

CI Cost Is A Product Decision

Oracle Free containers are heavier than Postgres. The course notes make that cost explicit and reserve the Oracle lane for main branch pushes and release PRs.

That is not lowering the standard; it is placing expensive proof where it protects decisions.

The Interview Artifact

oracle-notes.md is part of the proof. It names identity, pagination, type mapping, timestamp semantics, and the overlap strategy.

A candidate who can point to those notes and tests is no longer hand-waving cross-database support.