Pcornel
Browse topics
Options
Recent
Favorites
Databases · Technical reference

Database Fundamentals

Direct answer

A database stores structured data and serves it to applications through queries, guaranteeing consistency with transactions. Relational databases (PostgreSQL, MariaDB/MySQL, SQL Server) use tables, keys and SQL.

When to use this

Use it as the entry point for database questions: connectivity, queries, performance, backup or replication.

First 30 seconds

1. Engine and version: SELECT version(); (PG) / SELECT VERSION(); (MySQL) / SELECT @@VERSION (MSSQL).

2. Can the app connect? host, port, credentials.

3. Slow or failing query → plan and locks.

4. Server resources: CPU, memory, disk, connections.

5. Backups recent and tested?

Operational verification

application → connection (network, auth) → SQL → planner → storage engine → result

Evidence · next step

Typical mistakes are mixing server/instance/database terminology, assuming ACID eliminates application-level race conditions, treating TCP reachability as a successful database session, or blaming storage before checking locks, sessions and engine state. Preserve the first divergent observation and repeat the same bounded verification after remediation.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
What not to infer

Databases owns engine and data-model behavior. Linux/Windows own the host; Storage owns filesystems/block durability; application code/ORM behavior is outside this infrastructure-focused Domain.

Platform / version applicability
MariaDB / MySQL / PostgreSQL / Microsoft SQL Server concepts
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformMariaDB / MySQL / PostgreSQL / Microsoft SQL Server concepts · Databases owns engine and data-model behavior. Linux/Windows own the host; Storage owns filesystems/block durability; application code/ORM behavior is outside this infrastructure-focused Domain.
Scope / prerequisiteUse it as the entry point for database questions: connectivity, queries, performance, backup or replication.
What next?3 suggested next steps
Child topics (this level)3
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification workflow Verify boundary

Identify the engine/product, server/instance, database and schema before running administrative commands. Verify connectivity, session context and a bounded read/write transaction, then distinguish engine health from a particular database, query or application connection pool.

Step 2 Failure signatures and limits Narrow the fault

Typical mistakes are mixing server/instance/database terminology, assuming ACID eliminates application-level race conditions, treating TCP reachability as a successful database session, or blaming storage before checking locks, sessions and engine state.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

test · 1
Drill down

Subtopics

Go one level deeper into this subject.

Key points

Separate the layers: network and authentication, the SQL itself, locks/transactions, server resources, and storage. Always know which engine and version you are on — syntax and tools differ.

Key checks
  • SELECT version(); — first check for this topic
  • psql -c "SELECT now(), version();" — PostgreSQL reachable and version
  • mysql -e "SELECT NOW(), VERSION();" — MariaDB/MySQL reachable and version
  • sqlcmd -S <server> -Q "SELECT @@VERSION" — SQL Server reachable and version
ReferenceWhat it is1 section · depth on demand

Operating model

Database Fundamentals defines the operational model for relational database systems: a database engine accepts sessions, executes transactions against structured data, maintains durability/consistency state and exposes administrative boundaries such as instances, databases, schemas, tables and users. Exact terminology differs by product, so identity and scope must be explicit.

ReferenceHow it works1 section · depth on demand

In depth

A relational database stores data in tables of rows and columns, linked by keys, and lets applications query and change it with SQL while guaranteeing consistency through transactions. Understanding a few core concepts explains most database behaviour that operations teams meet.

ConceptMeaning
Table, row, columnStructured data with defined types
Primary keyUnique identifier for each row
Foreign keyReference to a row in another table
IndexStructure that speeds up lookups
TransactionGroup of changes that succeed or fail together
ACIDAtomicity, consistency, isolation, durability
Write-ahead log (WAL / redo / transaction log)Durability and recovery, replication source
EngineTypical use
PostgreSQLGeneral purpose, extensions, strong standards support
MariaDB / MySQLWeb applications, LAMP stacks
Microsoft SQL ServerWindows/.NET enterprise applications
SQLiteEmbedded, single-file databases

For operations, the key responsibilities are backups that can be restored, performance monitoring, security and controlled schema changes.

ReferenceImportant terms & boundaries1 section · depth on demand

Scope map

  • Relational model
  • Server → instance → database → schema → table boundaries
  • Rows, columns and keys
  • ACID
  • Connections and sessions
  • Client/server request lifecycle
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical examples

Configuration & expected output

Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.

Configuration example

PostgreSQL / MariaDB PostgreSQL 14+ or MariaDB 10.6+Connect and confirm server version, current database and user.

Assumptions: Client tools installed; credentials supplied through a password file or prompt, not on the command line.

psql "host=db1 dbname=app user=app_ro" -c "SELECT version(), current_database(), current_user;"
mariadb -h db1 -u app_ro -p app -e "SELECT VERSION(), DATABASE(), CURRENT_USER();"

Expected output

PostgreSQL / MariaDB PostgreSQL 14+ or MariaDB 10.6+psql -h db1 -U app_ro -d app -c "SELECT current_database(), current_user;"

Expected state: The session is connected to the intended database as the intended role.

current_database | current_user
------------------+--------------
 app              | app_ro
(1 row)
Always confirm database and role before running changes; many incidents are a correct statement run against the wrong server. Illustrative authored output: field layout matches the tool, values will differ in your environment.
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-29 · otherMariaDB / PostgreSQL / Microsoft SQL Server concepts PostgreSQL current documentation

Documentation verification: confirms the upstream model used by the Topic. It does not assert local production behavior.

Basis: https://www.postgresql.org/docs/current/tutorial-concepts.html · confidence 92%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
database fundamentalsdatabase basicsrelational database fundamentalsACID database
Embedded reference data

Quick lookup tables

Database Fundamentals verification boundary matrix

A compact lookup separating intent, owning component state, effective state and consumer-visible outcome for Database Fundamentals.

BoundaryInspectHealthy interpretationDo not infer
IntentRelational modelIntended object/scope is explicit and versioned where relevantIntent is already effective
Owning runtime/control planeServer → instance → database → schema → table boundaries / Rows, columns and keysOwner accepts and reports the expected object stateDownstream dependencies are healthy
Effective stateACIDIndependent read-back matches the intended stateEvery client sees the same result
Consumer outcomeConnections and sessionsThe original bounded check succeeds in the same time windowProduction correctness outside this scope
Depth when you need it

Deep reference

Design & tradeoffs

Scope

Databases owns engine and data-model behavior. Linux/Windows own the host; Storage owns filesystems/block durability; application code/ORM behavior is outside this infrastructure-focused Domain.

Confirmation

Confirm action

Continue?