databases/
Tables, queries, indexes, transactions, storage engines and caching.
5 results
databases/caching-why-the-second-read-is-fast-and-how-a-copy-goes-stale.md
Caching: why the second read is fast, and how a copy goes stale
Why does a page load slowly the first time and fast the second? Usually a cache: a quick copy of an answer the database already gave. Run a…
databases/the-n-1-query-problem-why-a-page-that-asks-the-database-501-questions.md
The N+1 query problem: why a page that asks the database 501 questions is slow
A page that lists authors and their books can quietly send one query per author. With 500 authors that is 501 trips to the database, and…
databases/transactions-why-a-money-transfer-must-save-both-changes-or-neither.md
Transactions: why a money transfer must save both changes or neither
Sending £50 between two accounts takes two changes to a database. If the power fails between them, the money vanishes. A transaction groups…
databases/database-transactions-why-moving-money-is-all-or-nothing.md
Database transactions: why moving money is all or nothing
Paying someone is really two changes in a database: take money from one account, add it to another. If the power dies between them, money…
databases/what-is-a-database-index-find-one-row-without-reading-them-all.md
What is a database index? Find one row without reading them all
Ask a database for one person among a million rows and it could read every row until it finds them. That is slow. An index is the…