Why a database instead of a file
You could save data to a plain .json file, but that breaks under real use. If two requests edit the file at once, data is lost or corrupted.
A database handles this safely:
- It supports many users at the same time (concurrency).
- It keeps your data consistent with **transactions*: all of a change happens, or none of it.
- It lets you ask smart questions with SQL, like "give me all users who signed up last week."
SQLite brings all of this into a single file you can back up by copying.