postgres in a container on the same box, or managed at $19/mo for 8gb of data Backups
Currently postgres 17 in compose next to the app, data on a mounted volume, pg_dump to R2 nightly from a cron container. 8 GB and growing maybe 400 MB a month. Two-person team, no ops person, we ship a lot.
Someone on the team wants to move to managed because "nightly dumps mean up to 24 hours of data loss", which is true. But managed is $19-25 and, more to the point, adds a network hop and I'm not sure what else.
If you run postgres in docker in production — what actually went wrong for you?
@negativesplitz · 3w ago · 3 replies
Things that actually went wrong for me, ordered by how much they hurt:
postgres:16to17in compose does not migrate your data directory — the container starts, sees an incompatible PGDATA and refuses. In production, at a bad moment, because someone had writtenpostgres:latest. Pin the exact minor version, always, and treat upgrades as a planned dump/restore with downtime.Your colleague is right about the exposure and wrong about the fix. You don't need managed to close a 24-hour window, you need WAL archiving. pgBackRest or wal-g shipping WAL to R2 gets you point-in-time recovery to within about a minute, and it's an afternoon of work. That capability is most of what managed is actually selling you.
Reply
Report
@coworking_cass · 3w ago
wal-g to R2 it is. I think we'd both quietly assumed PITR was a managed-only capability, which is just wrong.
Reply
Report
@mulch_mule · 3w ago
Set it up, then restore to a specific point in time on a throwaway box before you believe any of it. Setup is the easy half.
Reply
Report