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

For a while now, I've used H2 as the in-memory database for a bunch of Selenium and Spring Boot integration tests. The primary advantages are 1. speed and 2. simplicity.

Simplicity is the big thing here; I can configure Spring to launch an in-memory H2 database and not have to worry about state, clearing and reseeding, or any of that stuff. The integration tests can just run.

I've been so happy with it that I'm pushing a customer to use H2 in production. I would normally use Postgres, but my customer doesn't really have an IT staff, and an embedded database will be a lot easier for them to keep up and running.



Yeah, H2 is amazingly good. I've used it for things that most Java developers insist it can't be used for. :)

Just understand that any use that even vaguely resembles production will usually get pushback from people who think it is only a dev-level in-memory-only toy that causes constant slowdowns. This will be true even if it is only used for a few hundred rows worth of data.


Wouldn't your customer lose all their data if the app crashes?


H2 has a disk persistence mode.

Though I’d probably use SQLite for this use case




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

Search: