Using a database to store data is preferred in below scenarios
- When data to be stored is huge and/or is growing rapidly
- When there are concurrent connections trying to perform DML operations on the data(Insert/Update/Delete)
- When you want to apply some kind of security on the data to determine which data should be accessible to whom
- Whenever you want to bring in some reliability in your results even in case of any intermediate failures like power outage etc