How to speed up database integration tests using Docker and tmpfs

preview_player
Показать описание
In this video, I'm going to demonstrate how you can speed up database integration tests using Docker and tmpfs. By using this strategy, you will be able to run MySQL or PostgreSQL integration tests almost as fast as when using an in-memory database, like H2 or HSQLDB.

This video is a sample of my High-Performance Java Persistence video course. So, if you like it, you are going to love the entire course series.

Рекомендации по теме
Комментарии
Автор

I added
container.withTmpFs(Map.of("/var/lib/postgresql/data", "rw"));
for my postgres test containers images and it did improve my build times by 15-25% (depending on a project) so the test execution is visibly quicker. Thanks!

jkickic
Автор

In Windows 10 is there a way to create tmpfs?

vagnerdasilva