Persistence, auth, and multi-user data
Notebook· 12.05· 3–4 h· Lesson 104 of 129
The notebook opens in your lab, in a new tab. If your server is stopped, it starts first (a few seconds).
By the end you can
- List what must survive a restart: the conversation (checkpointer) and the service's own state (threads, owners, runs, events, idempotency keys, spend).
- Run the service on SQLite and restart it: threads continue, finished runs replay, idempotency keys still work, paused approvals resume.
- Close runs that a crash cut off, so no client waits forever.
- Switch to Postgres with the same code:
setup(), connection pools, autocommit, strict deserialization. - Authenticate with signed tokens (JWT): verify signature, expiry, issuer and audience, and reject
alg: none. - Isolate users' data and delete it on request (threads, runs, events and checkpoints).
Before you start
Lesson 12.04 (the service), Lesson 03.04 (checkpointers) and Lesson 08.03 (interrupts).
