Black Friday: the Laravel testing course is $149 instead of $249, through Dec 7. See the course →
logo

Why two databases are better than one

We just love talking about testing

Joel Clermont
Joel Clermont
2025-03-10

From our daily Laravel tips email. Get the next one in your inbox.

Early in my Laravel days, I would bump into way more flaky tests than I do now. One big reason for the improvement was moving to a separate testing database.

In the latest episode of the No Compromises podcast, we discuss the benefits of having distinct databases for testing and local development. We explain how this approach ensures a reliable test suite and avoids conflicts with day-to-day dev work. In the process, we reveal a simpler workflow for setting up new environments and keeping projects stable.

  • (00:00) - Why separate dev and test databases
  • (02:15) - Automating database setup with seeders
  • (05:00) - Avoiding flaky tests and migration pitfalls
  • (09:00) - Reimagining old habits with new practices
  • (12:00) - Silly bit

Listen Now (15 min)

And after listening, don't forget to subscribe to the podcast, so you don't miss future episodes.

Here to help,

Joel

P.S. Simple changes like this can have a big impact. Imagine how many tiny, but impactful, insights you could pick up from the Mastering Laravel community!

Want a tip like this in your inbox every weekday?

Each one takes less than 2 minutes to read. Join 4,000+ Laravel developers who already get them.

email
No spam. Only real-world advice.
Toss a coin in the jar if you found this helpful.