Seeds should contain realistic not minimal data

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the architecture category.

Last Updated: 2024-11-23

I added some development seed data to my Rails app and I was unsure whether to manually make just a pair instances for each class (and therefore have super simple seed code) or to produce a large set of data .

It turns out, the downside with having just 2-3 records is that performance is difficult to get a feel for. All DB queries seem optimized, both in terms of feel (browsing the development environment is super snappy) and with automated tools like Bullet which fail at spotting N+1 issues since, well, there is no N!

Therefore, in future (and for relatively mature apps), generate a few thousand records to get a realistic feel.