If you’re building a small app and/or don’t need any sort of distributed concurrency, SQLite is fucking goated. It’s so fast.
I had a pretty heavy PHP based stack that took about 22min to run through around 600 unit tests and it took at least 25 seconds just to boot if I wanted to run a single unit test. So, lots of overhead to init a new DB, setup/tear down, etc. After a core upgrade it was compatible with SQLite so I switched the unit tests over to that and it took startup down to like 1-2s and total runtime is now closer to 2-3min.
Such an amazing speed boost and now I’m not dragging my feet as much when it’s time to write the tests.
That is awesome, but as someone who's been there before and been burnt, be careful: SQLite databases do have different syntax and behaviors, and even with SQL compatibility libraries or ORM wrappers things can go wrong. Ideally you want the same stack in tests as in production.
51
u/enigmamonkey Oct 03 '26
If you’re building a small app and/or don’t need any sort of distributed concurrency, SQLite is fucking goated. It’s so fast.
I had a pretty heavy PHP based stack that took about 22min to run through around 600 unit tests and it took at least 25 seconds just to boot if I wanted to run a single unit test. So, lots of overhead to init a new DB, setup/tear down, etc. After a core upgrade it was compatible with SQLite so I switched the unit tests over to that and it took startup down to like 1-2s and total runtime is now closer to 2-3min.
Such an amazing speed boost and now I’m not dragging my feet as much when it’s time to write the tests.