Save app data in a database
Your app ships with a database turned on; schema changes ride each deploy and a failed change keeps the old version live.
Your app comes with its database switched on. You ask for features that need saving, and the data persists between visits. The next pages cover files, sign-in, schedules, background work, realtime, email, and backups.
How your data is stored
Your app gets one database (D1) and one file bucket. Asking for a second one fails the deploy, so keep everything in the single database.
The starter list pattern, a page that reads the database plus forms that write to it, covers most needs.
How schema changes ship
When your app needs new fields or tables, the change rides the next deploy:
- The new version passes review first.
- The database updates before the new version serves traffic.
- If the update fails, nothing uploads and your old version keeps serving.
How to browse your data
Open your app in the Console. Go to Data and open the D1 browser, which shows tables, row counts, and lets you sort, search, add, edit, and delete rows.
Backups run automatically. See Back up and restore your data.
For the technical detail, your builder reads Store data in D1.