Back to browse
GitHub Repository

Isolated, seeded database environments for parallel testing.

4 starsGo

Petri – Drop-in Postgres image that forks a DB per test

by nizarmah·May 13, 2026·4 points·0 comments

AI Analysis

●●SolidBig BrainSolve My ProblemShip It

Proxy auto-forks Postgres DBs per connection so parallel tests never clash.

Strengths
  • Proxy on port 5433 automates CREATE DATABASE TEMPLATE without requiring code changes.
  • Avoids container spin-up overhead compared to Testcontainers for every test case.
  • Deployed on 4,257 tests internally, proving real-world viability beyond simple demos.
Weaknesses
  • Requires using a single-connection pool per test to maintain strict isolation guarantees.
  • Template creation has slight overhead compared to pure transaction rollback strategies.
Target Audience

Backend developers managing flaky integration test suites

Similar To

Testcontainers

Post Description

Rolling it out at work to parallelize 4,257 tests across 5 services. It fixes our tests running in band and DB mocking in API tests.

It's a drop-in Postgres image, with a Golang proxy. :5432 is passthrough, :5433 forks the DB per conn (CREATE DATABASE … TEMPLATE …, dropped on disconnect).

If you use it, let me know what you like or don't like, so I can make it better. Cheers!

Similar Projects

Developer Tools●●Solid

Drag-and-Drop in the Terminal

Cell-by-cell diff rendering hits O(changed cells) while Ink redraws entire frames.

WizardryNiche Gem
re-marked
201mo ago