What is a Database?

A database stores structured data and answers queries reliably, even with many users writing at once.

Beginner 5 min IT Fundamentals
Structured state · queried and updated
  • Read path
  • Result path
  • Write & commit
DATABASE ENGINESTORED DATA — SURVIVES RESTARTSApplicationKeeps no lasting state itselfQUERY · READSELECT id, email, cityFROM usersWHERE id = 42;Says what is wanted, not how to find itWRITE · CHANGES STATEUPDATE usersSET city = 'Berlin'WHERE id = 42;INSERT works the same wayRESULT SET · 1 ROWid | email | city42 | ada@… | ParisOnly the rows that matched01 · PARSE & PLANUnderstand, then chooseFilter on an indexed column → index lookupNo useful index → read every row02 · ACCESS PATHIndex lookup03 · TRANSACTIONAll of it, or none of itROLLBACK04 · RESULTMatching rows, assembledINDEX ON users(id)TABLE · usersDURABLE STORAGEData files + write-ahead logCommitted before the write is acknowledgedStill there after the app stops or restarts
A query describes what is wanted; the engine plans it, reaches the rows through an index and returns only what matched. Writes run inside a transaction that either commits to durable storage or rolls back completely — and the data outlives the application process.

Hover a component to isolate its path; click the application, the query, the planner, the index, the table, the transaction or the storage layer for a short explanation.

Next conceptWhat is an API?An API is a documented contract that lets one piece of software ask another to do something.