Guide LESSON · BEGINNER
What a database actually does for you
The database is the part of your app that remembers after the request ends and after the program restarts. Everything else in the app can be rebuilt from your code. The database holds the thing that cannot.
By the end you can
- An app forgets nearly everything.
- A database is the place the app writes things down so they survive.
- An app is a program, and programs get restarted.
- The restart takes the app's local state with it.
What this is about
The database is the part of your app that remembers after the request ends and after the program restarts. Everything else in the app can be rebuilt from your code. The database holds the thing that cannot.
The corollary, and the reason this is a reality check rather than a definition: "it worked when I refreshed" is not evidence that anything was saved. A refresh reaches an app that is still running, so it can answer correctly from state that will not survive the next restart.
How it actually goes
- 01
An app forgets nearly everything.
The database is the part that remembers.
- 02
A database is the place the app writes things down so they survive.
Everything else the app is holding is scratch paper for one visit.
- 03
An app is a program, and programs get restarted.
A deploy restarts it. So does a settings change, and so does the environment moving it somewhere else.
- 04
The restart takes the app's local state with it.
The rule the twelve-factor text states is the one worth teaching: never assume anything held in memory or on local disk will be there on a future request.
- 05
The concrete case.
A customer types something and hits save. If that value only lived inside the running app, the next deploy takes it away. There is no error. It is gone.
- 06
Refreshing is not the test.
The app is still running while you refresh, so it can still be holding your answer. A restart is the test.
- 07
The second job.
A database is also the one place where two people acting at the same moment has to come out right.
- 08
All or nothing.
A database can bundle several changes into one step where either every part lands or none of it does. The film teaches this shape without naming it, because the word for it belongs to the Intermediate film (catalog F21).
- 09
The limit.
This does not tell you how to shape your data, and it does not tell you which database to pick. The exact guarantees depend on the engine you end up using.
- 10
The action.
Ask the AI which parts of the app only remember while it is running, then ask what happens to each one after a restart.
- 11
The recap.
Whatever your app has not written to the database, it forgets.
KEEP THE PROMPTS COMING
Get the free Agent Playbook + the exact prompts.
This whole playbook is free — no signup wall, ever. Drop your email and we'll send the copy-paste prompts from this page plus one plain-English AI move a week for your business. Unsubscribe in one click.
- The exact prompts to run with your agents
- New playbooks the moment they ship
- No hype, no spam — unsubscribe anytime
→ WANT IT BUILT FOR YOU?
