That’s for you to decide. Databases are more secure, but they also take more work (unless you already know everything about a database, you’re going to need to learn how to interact with it). Storing data in plain text also allows users to view or edit it directly, which could be an advantage or a disadvantage depending on your use case.
If you’re honestly not sure, it’s most likely easier to transition from writing to
.json files to writing to a database than transitioning between unlike databases, so starting with file-saving could be a good measure to test your logic with output you can easily see and then transition to a database if you desire.