[Atomic Glue](atomicglue.co)
BACKEND
Home › Glossary › Backend· 127 ·

Database

\\day-tuh-bays\\n.
Filed underBackendSoftware EngineeringAnalyticsInfrastructure
In brief · quick answer

A database is an organized collection of structured data stored and accessed electronically. It provides persistent storage, efficient retrieval, concurrent access, and data integrity through a Database Management System (DBMS).

§ 1 Definition

A database is a system for storing, organizing, and retrieving data. The term usually refers to both the data itself and the Database Management System (DBMS) that manages it. Databases range from simple embedded stores (SQLite) to distributed systems spanning dozens of servers (Cassandra, Spanner). The two major categories are relational (SQL) databases, which store data in structured tables with predefined schemas and relationships, and non-relational (NoSQL) databases, which store data in flexible formats like documents, key-value pairs, graphs, or wide columns. Every web application relies on at least one database layer. The choice of database is one of the most consequential architecture decisions in any project. It affects data modeling, query patterns, scaling strategy, consistency guarantees, and operational complexity. The right database depends on your data structure, access patterns, consistency requirements, and scale.

§ 2 Database Management System (DBMS)

The DBMS is the software layer between the application and the raw data. It handles storage, indexing, query execution, concurrency control, transaction management, access control, backup, and replication. The DBMS ensures ACID properties (Atomicity, Consistency, Isolation, Durability) for transactions. It provides a query language (typically SQL) for data manipulation. Key components include the query optimizer, storage engine (InnoDB, RocksDB, WiredTiger), buffer pool, transaction log, and replication mechanism. The DBMS design determines the database's performance characteristics: read-heavy vs write-heavy, point lookups vs range scans, OLTP (many small transactions) vs OLAP (large analytical queries).

§ 3 Relational vs Non-Relational

The fundamental divide is between relational and non-relational databases. Relational databases (PostgreSQL, MySQL, SQLite, SQL Server) store data in tables with fixed schemas, enforce relationships through foreign keys, and use SQL for queries. They guarantee ACID transactions and are the default choice for most applications. Non-relational databases (MongoDB, Redis, Cassandra, Neo4j) trade some of these guarantees for flexibility, speed, or specialized data models. Document databases store JSON-like documents. Key-value stores are the simplest and fastest. Graph databases model relationships explicitly. Wide-column stores handle massive scale. The choice is not binary. Many applications use multiple databases (PostgreSQL for transactional data, Redis for caching, Elasticsearch for search).

§ 4 Database Deployment: Self-Hosted vs Managed

Self-hosting a database means installing and managing the DBMS on your own infrastructure. You control configuration, version upgrades, backup schedules, and security hardening. You also handle failure recovery, capacity planning, and operational monitoring. Managed databases (RDS, Cloud SQL, Supabase, Neon, PlanetScale) offload operations to a cloud provider. The provider handles backups, patching, replication, failover, and scaling. Managed databases are almost always the right choice for teams without dedicated database administrators. The premium over self-hosting is worth the reduction in operational risk. For development and small applications, serverless databases (Neon, PlanetScale, Turso) provide the best experience with zero provisioning.

§ 5 Note

Common misunderstanding: 'NoSQL means no SQL.' Modern NoSQL databases acknowledge SQL's utility. MongoDB has a SQL-like aggregation pipeline. Cassandra has CQL (Cassandra Query Language), which looks like SQL. The term 'NoSQL' originally meant 'Not Only SQL.' Another misconception: you must choose between SQL and NoSQL for your entire application. Most production systems use multiple databases, chosen for different workloads. PostgreSQL for transactions, Redis for caching, Elasticsearch for search. This is called polyglot persistence. Also: newer databases like PostgreSQL support JSON columns and document-like queries, blurring the SQL/NoSQL line.

§ 6 In code

```sql
-- Creating a relational database schema
CREATE TABLE users (
  id        UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  email     TEXT UNIQUE NOT NULL,
  name      TEXT NOT NULL,
  role      TEXT NOT NULL DEFAULT 'user' CHECK (role IN ('user', 'admin')),
  created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);

CREATE TABLE posts (
  id         UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id    UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
  title      TEXT NOT NULL,
  body       TEXT NOT NULL,
  created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);

CREATE INDEX idx_posts_user_id ON posts(user_id);

-- Query with join
SELECT u.name, p.title, p.created_at
FROM users u
JOIN posts p ON p.user_id = u.id
WHERE u.email = '[email protected]'
ORDER BY p.created_at DESC
LIMIT 10;
```

§ 7 Common questions

Q. Which database should I start with for a new application?
A. PostgreSQL. It is the most versatile database, supporting relational data, JSON, full-text search, geospatial queries, and more. Start with PostgreSQL and add specialized databases only when you have a clear need.
Q. What is the difference between OLTP and OLAP?
A. OLTP (Online Transaction Processing) handles many small, concurrent transactions. That is your application database. OLAP (Online Analytical Processing) handles complex queries over large datasets for reporting and analytics. Different databases optimize for each.
Q. Should I host my own database or use a managed service?
A. Use a managed service unless you have a dedicated database administrator. Managed databases handle backups, patching, failover, and monitoring. The cost premium is worth eliminating the operational burden.
Key takeaways
  • A database is a system for persistent, structured, concurrent data storage and retrieval.
  • Relational (SQL) databases use tables, schemas, and ACID transactions. NoSQL databases offer flexibility or specialized performance.
  • PostgreSQL is the default choice for most new applications.
  • Use managed databases unless you have a dedicated DBA. Polyglot persistence is normal.
How Atomic Glue helps

Atomic Glue designs and manages database architectures for every web application we build. PostgreSQL is our default database choice. We model schemas, write optimized queries, set up replication and backups, and manage migrations. For specialized workloads, we integrate Redis (caching), Elasticsearch (search), and SQLite (embedded). Database design is a foundational layer of our Web Development services. Get in touch to design your database architecture.

Get in touch
# Database

A database is an organized collection of structured data stored and accessed electronically. It provides persistent storage, efficient retrieval, concurrent access, and data integrity through a Database Management System (DBMS).

Category: Backend (also: Software Engineering, Analytics, Infrastructure)

Author: Atomic Glue Development Team

## Definition

A database is a system for storing, organizing, and retrieving data. The term usually refers to both the data itself and the Database Management System (DBMS) that manages it. Databases range from simple embedded stores (SQLite) to distributed systems spanning dozens of servers (Cassandra, Spanner). The two major categories are relational (SQL) databases, which store data in structured tables with predefined schemas and relationships, and non-relational (NoSQL) databases, which store data in flexible formats like documents, key-value pairs, graphs, or wide columns. Every web application relies on at least one database layer. The choice of database is one of the most consequential architecture decisions in any project. It affects data modeling, query patterns, scaling strategy, consistency guarantees, and operational complexity. The right database depends on your data structure, access patterns, consistency requirements, and scale.

## Database Management System (DBMS)

The DBMS is the software layer between the application and the raw data. It handles storage, indexing, query execution, concurrency control, transaction management, access control, backup, and replication. The DBMS ensures ACID properties (Atomicity, Consistency, Isolation, Durability) for transactions. It provides a query language (typically SQL) for data manipulation. Key components include the query optimizer, storage engine (InnoDB, RocksDB, WiredTiger), buffer pool, transaction log, and replication mechanism. The DBMS design determines the database's performance characteristics: read-heavy vs write-heavy, point lookups vs range scans, OLTP (many small transactions) vs OLAP (large analytical queries).

## Relational vs Non-Relational

The fundamental divide is between relational and non-relational databases. Relational databases (PostgreSQL, MySQL, SQLite, SQL Server) store data in tables with fixed schemas, enforce relationships through foreign keys, and use SQL for queries. They guarantee ACID transactions and are the default choice for most applications. Non-relational databases (MongoDB, Redis, Cassandra, Neo4j) trade some of these guarantees for flexibility, speed, or specialized data models. Document databases store JSON-like documents. Key-value stores are the simplest and fastest. Graph databases model relationships explicitly. Wide-column stores handle massive scale. The choice is not binary. Many applications use multiple databases (PostgreSQL for transactional data, Redis for caching, Elasticsearch for search).

## Database Deployment: Self-Hosted vs Managed

Self-hosting a database means installing and managing the DBMS on your own infrastructure. You control configuration, version upgrades, backup schedules, and security hardening. You also handle failure recovery, capacity planning, and operational monitoring. Managed databases (RDS, Cloud SQL, Supabase, Neon, PlanetScale) offload operations to a cloud provider. The provider handles backups, patching, replication, failover, and scaling. Managed databases are almost always the right choice for teams without dedicated database administrators. The premium over self-hosting is worth the reduction in operational risk. For development and small applications, serverless databases (Neon, PlanetScale, Turso) provide the best experience with zero provisioning.

## Note

Common misunderstanding: 'NoSQL means no SQL.' Modern NoSQL databases acknowledge SQL's utility. MongoDB has a SQL-like aggregation pipeline. Cassandra has CQL (Cassandra Query Language), which looks like SQL. The term 'NoSQL' originally meant 'Not Only SQL.' Another misconception: you must choose between SQL and NoSQL for your entire application. Most production systems use multiple databases, chosen for different workloads. PostgreSQL for transactions, Redis for caching, Elasticsearch for search. This is called polyglot persistence. Also: newer databases like PostgreSQL support JSON columns and document-like queries, blurring the SQL/NoSQL line.

## In code

## Common questions
Q: Which database should I start with for a new application?
A: PostgreSQL. It is the most versatile database, supporting relational data, JSON, full-text search, geospatial queries, and more. Start with PostgreSQL and add specialized databases only when you have a clear need.
Q: What is the difference between OLTP and OLAP?
A: OLTP (Online Transaction Processing) handles many small, concurrent transactions. That is your application database. OLAP (Online Analytical Processing) handles complex queries over large datasets for reporting and analytics. Different databases optimize for each.
Q: Should I host my own database or use a managed service?
A: Use a managed service unless you have a dedicated database administrator. Managed databases handle backups, patching, failover, and monitoring. The cost premium is worth eliminating the operational burden.

## Key takeaways

## Related entries


Last updated June 2026. Permalink: atomicglue.co/glossary/database

Schedule a call

30 min · Video call

1
Date
2
Time
3
Details