Data and databases checklist
Every rule in the data and databases playbook, by chapter, required rules first. Each links to its own page with how we built it and how to check it. This is a lot to check. An Expert can check it for you.
Schema design
- Recommended DAT-1 Enforce rules with constraints
- Recommended DAT-2 Choose exact types
- Recommended DAT-3 Give every row a stable key
- Recommended DAT-4 Name things the same way everywhere
- Recommended DAT-5 Keep one fact in one place
- Recommended DAT-6 Plan how rows are removed
- Recommended DAT-76 Keep the history of records that settle disputes
- Recommended DAT-77 Check the shape of JSON columns in the database
Queries and indexes
- Recommended DAT-9 Index the queries you run
- Recommended DAT-10 Read the query plan
- Recommended DAT-11 Load related rows in one query
- Recommended DAT-12 Select only the columns you use
- Recommended DAT-13 Page through long lists by key
Transactions and concurrency
- Required DAT-14 Wrap multi-step changes in a transaction
- Required DAT-16 Make conditional writes
- Recommended DAT-15 Know your isolation level
- Recommended DAT-81 Retry transactions that fail on a conflict
- Recommended DAT-78 Import files through a staging table
Migrations
- Required DAT-22 Expand first and contract later
- Required DAT-23 Keep migrations from locking tables
- Required DAT-25 Fix production data with reviewed scripts
- Recommended DAT-20 Change the schema only with migrations
- Recommended DAT-21 Never edit an applied migration
- Recommended DAT-24 Test migrations on a copy of production data
Backups and recovery
- Required DAT-28 Prove restores work
- Recommended DAT-27 Keep point-in-time recovery for busy databases
- Recommended DAT-29 Test what a failover loses
Personal data
- Required DAT-30 Store only the personal data you need
- Required DAT-31 Delete old data automatically
- Required DAT-32 Keep personal data out of test copies
- Required DAT-34 Log who reads personal data
- Required DAT-35 Erase retired databases and every copy
- Recommended DAT-79 Pause deletion for records under a legal hold
Operations
- Required DAT-37 Set time limits on every query
- Required DAT-58 Upgrade the database before its support ends
- Recommended DAT-36 Pool database connections
- Recommended DAT-38 Watch slow queries
- Recommended DAT-39 Let routine maintenance run
- Recommended DAT-42 Turn on checksums and check for corruption
- Recommended DAT-43 Rebuild text indexes when the collation library changes
Database security
- Required DAT-8 Pass values as parameters
- Required DAT-26 Encrypt backups
- Required DAT-80 Encrypt database storage with a key you control
- Recommended DAT-41 Give the app a least-privilege database user
- Recommended DAT-66 Log in to the database with SCRAM instead of MD5
- Recommended DAT-59 Turn off database features that reach the server
Caches and copies
- Recommended DAT-44 Name the source of truth
- Recommended DAT-46 Read from replicas only what may lag
- Recommended DAT-82 Give each row one home region before you replicate across regions
Multi-tenancy
- Required DAT-7 Keep each customer's data apart
- Required DAT-83 Turn on row-level security for every table
- Required DAT-68 Run every background job inside its tenant
- Required DAT-72 Delete every copy of a tenant when the contract ends
- Required DAT-75 Pin each tenant's data to its region
- Recommended DAT-67 Choose the isolation model before the first customer
- Recommended DAT-69 Keep each tenant's files under its own prefix
- Recommended DAT-70 Put the tenant on every log line and trace
- Recommended DAT-71 Restore and export one tenant alone
- Recommended DAT-73 Find and contain noisy neighbours
- Optional DAT-74 Give each tenant its own encryption key when customers ask to hold it
Related playbooks
Show the badge on your project
When your project passes every Required rule, you can show this badge on your site or in your README. It links to this checklist, so anyone can run the same checks.
<a href="https://agentwranglers.se/playbook/data/checklist"><img src="https://agentwranglers.se/badge.svg" alt="Checked against the Agent Wranglers data and databases playbook" width="214" height="20"></a>
[](https://agentwranglers.se/playbook/data/checklist)
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/data/checklist">Agent Wranglers data and databases playbook</a>. In code you write, add a comment next to it with the same link.