termEngineering & architecture

Database

An organized store of persistent data managed so software can create, retrieve, update, protect, and recover information.

Download Markdown (.md)

01What it means

A database is an organized collection of data managed by a database system. The system provides mechanisms to store, query, update, constrain, secure, and recover data. Databases use different models—including relational, document, key-value, graph, and wide-column—whose structures and guarantees suit different access patterns.[1][2]

Managed data with explicit structure and guarantees The database coordinates storage, retrieval, correctness, security, and recovery
Database management system
Data model
Structure and relationships
Queries + updates
Language, API, or driver
Constraints
Correctness and identities
Indexes
Measured access paths
Concurrency + durability
Coordination and persistence guarantees
Operations
Security, backup, recovery, capacity, migration

Relational, document, key-value, graph, and wide-column models suit different relationships, access patterns, and guarantees.

02Why it matters

Product accounts, orders, content, permissions, and operational records must survive individual processes and remain usable as the product changes. Database choices influence correctness, latency, scalability, analytics, privacy, recovery, and the cost of future changes.

03When to use it

Use a database when structured or semi-structured product state must persist, be queried, shared, or recovered reliably. A file, object store, cache, search engine, or event log may be better for a narrower workload, and many systems combine specialized stores deliberately.

04How it works

  1. Model the data, relationships, access patterns, retention needs, and correctness requirements.
  2. Choose a database model and system whose guarantees and operational characteristics fit those needs.
  3. Define structures, constraints, indexes, identities, and access controls.
  4. Applications issue reads and writes through a query language, API, or driver.
  5. The database coordinates storage, concurrency, durability, and retrieval according to its guarantees.
  6. Operate backups, recovery tests, monitoring, capacity planning, migrations, and lifecycle policies.

05A practical example

Example

A marketplace stores customers, listings, orders, and payment references in a database. Constraints prevent orders without valid customers, transactions preserve multi-step updates, indexes support common lookups, and tested backups protect against operator or infrastructure failure.

06Where it breaks

A database cannot correct a poor domain model, ambiguous ownership, unsafe access, or missing retention policy. Every system trades among consistency, availability, latency, query flexibility, cost, and operational complexity, and persistence does not replace tested backups.

Common mistakes

  • Choosing a database from popularity before defining access patterns and correctness needs.
  • Treating the database as an integration interface shared freely by unrelated services.
  • Assuming replication is a backup or that backups work without restoration tests.
  • Keeping data indefinitely without privacy, retention, deletion, and archival decisions.

07Sources

  1. Architectural FundamentalsPostgreSQL Global Development Group · Official technical documentationArchitectural Fundamentals
  2. Databases and CollectionsMongoDB · Official technical documentationDatabases and Collections
View saved topics

Start typing to search titles, definitions, categories, and frameworks.