Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Sean Smith13,797 Points
DatabaseLoader for production app?
Does using the DatabaseLoader to populate a database make sense for an app that will see production? If not, is there a better or more scaleable approach that I should be taking?
Alexander NikiforovJava Web Development Techdegree Graduate 22,175 Points
I think the better way is to have actual database with values, and just read the data properly from it into application.
This way other people that actually create Data for you can fill data elsewhere.
DataLoader is especially nice for testing purposes.
Since Spring Boot 1.4. You can simply annotate it with
@TestComponent and this way it will be used only in testing purposes. Thus you don't need to keep temporary databases for Unit Tests.