Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've had a nice experience using Docker Compose for this, although you might still want a task runner wrapper around it. Podman Compose should work fine as well.



My current setup on a personal project is docker compose with Postgres and pgadmin container.

I would never think of mocking a database in 2024/2025, just spin one up.

Also keep your lynch pin invariants in the database and not in your code.


> Also keep your lynch pin invariants in the database and not in your code.

I do both. That is how you protect against stressed devs at 2:00 AM trying to insert crap in the production database and how you also make good apps that don't blow up with database exceptions and give you neat validation errors in forms and/or JSON `errors` keys (when it's an API).


in 2024/2025 you just might be working with 985 petabyte database which just might have a few issues being “spun up” :)


I am definitely not talking about a full copy of the data here. I more head in mind a small but representative sample, enough to run and exercise units of code with confidence.


Are you developing directly against your production database?


replica in the staging environment


Exactly what I do. Having a local `docker-compose.yml` that helps bring up a dev and test environments is one of my first action items when hired. Paid huge dividends, many times.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: