System Design Space
Knowledge graphSettings

Updated: May 4, 2026 at 8:57 PM

Guide to Databases (short summary)

medium

A strong database guide matters not because it covers a lot, but because it turns relational theory, SQL, and distributed trade-offs into one usable engineering language.

In real work, the book is valuable as a calm foundation: it helps teams align on data modeling, transactions, replication, sharding, and where simple theory turns into architectural cost.

In interviews and architecture discussions, it helps you talk about databases without jumping between jargon and abstraction: from data model to queries, guarantees, and design consequences.

Practical value of this chapter

Relational and NoSQL practice

Convert theory into concrete criteria for model selection: transactionality, schema flexibility, and access patterns.

Trade-off language

Use one consistent vocabulary for replication, partitioning, and consistency discussions across teams.

Adoption checklist

Pair architecture decisions with observability, backup and recovery planning, and degradation scenario handling.

Interview storytelling

Structure answers as engineering reasoning: context, options, trade-offs, final choice, and consequences.

Official source

Postgres Pro

Free electronic version of the book on the Postgres Professional website, available without purchase or registration.

Download for free

Guide to Databases

Authors: V. I. Komarov
Publisher: DMK Press, 2024
Length: 520 pages

Postgres Pro textbook on relational modeling, SQL queries, DBMS architecture, indexes, transactions, replication, sharding, and NoSQL approaches.

Original

Why read this book?

The book builds a coherent map of databases: from data modeling and SQL to the distributed concerns that show up in system design.

  • Understand the foundations - relational algebra, normal forms, transactions, and the role of a DBMS
  • Read and write SQL with confidence - from basic selects to window functions, CTEs, and recursive queries
  • See how databases work inside - indexes, transactions, write-ahead logging, locks, and recovery
  • Prepare for system design discussions - talk about databases through properties, constraints, and consequences

Related chapter

PostgreSQL from the inside

Deep dive into MVCC, WAL, locks, and PostgreSQL indexes by Egor Rogov.

Читать обзор

What makes the book useful

Educational format

The material is structured as a course, with exercises, review questions, and labs. That makes it easier to enter the topic and practice as you go.

Relevance

Beyond relational theory and SQL, the book reaches NoSQL databases, distributed systems, big data processing, the CAP theorem, and eventual consistency.

Practical Focus

The theory is backed by PostgreSQL examples, so schema design, indexes, transactions, and queries can be tested against a real DBMS.

Free access

The electronic edition is free on the Postgres Professional website, which makes it a useful shared study resource for teams.

Related chapter

Database Internals

Deep dive into B-Trees, LSM trees, and distributed storage systems by Alex Petrov.

Читать обзор

Book structure

Part I: Introduction to Databases

Fundamentals of database theory: the path from file systems to DBMSs, relational modeling, normalization, ER diagrams, and schema design.

Relational model

Codd, relationships, keys

Normalization

1NF → BCNF, denormalization

ER modeling

Entities, relationships, attributes

Design

Logical and physical model

Part II: SQL Language

Full SQL path: from SELECT to analytical queries, DDL/DML, window functions, CTEs, and basic query optimization.

DML operations

SELECT, INSERT, UPDATE, DELETE

JOIN and subqueries

INNER, LEFT, RIGHT, FULL, CROSS

Window functions

ROW_NUMBER, RANK, LAG, LEAD

CTE and recursion

WITH, recursive queries

Part III: DBMS Architecture

DBMS internals: data storage, indexes, buffer cache, transactions, locks and failure recovery.

Data storage

Pages, heap, TOAST

Indexes

B-Tree, Hash, GiST, GIN

Transactions

ACID, isolation levels

WAL and recovery

Logging, checkpoint

Part IV: Distributed Systems

Replication, sharding, distributed transactions, the CAP theorem, consensus, and modern scaling approaches.

Replication

Leader-replica, multi-leader

Sharding

Horizontal partitioning

CAP theorem

Consistency, availability, network partition

Consensus

Paxos, Raft, 2PC

Part V: NoSQL and Big Data

Alternatives to relational DBMSs: document, key-value, wide-column, and graph databases, plus the big data ecosystem.

Document databases

MongoDB, CouchDB

Key-Value

Redis, Memcached, DynamoDB

Wide-column stores

Cassandra, HBase

Graph databases

Neo4j, JanusGraph

Comparing NoSQL database types

Document database

Nested JSON/BSON documents with flexible schema and rich field-level queries.

Examples

MongoDBCouchDBFirestoreElasticsearch

Use cases

CatalogsCMSUser profilesEvent logs

Data model

JSON/BSON documents

Query pattern

Field queries, indexes

Consistency

Tunable

Transactions

CharacteristicKey-valueDocument databaseWide-column storeGraph database
ScalabilityHorizontalHorizontalHorizontalHorizontal and vertical
ConsistencyEventualTunableTunableStrong
SchemaSchemalessFlexibleFlexibleFlexible
Transactions
JOINs

💡 When should NoSQL be considered instead of SQL?

  • Key-value: you need maximum speed and simple key-based operations
  • Document database: you need flexible schema, nested structures, and fast model evolution
  • Wide-column store: write volume, time-series data, and very large scale dominate
  • Graph database: the hard part is relationships and multi-hop traversal

Key Concepts for System Design

🔑Selecting a DBMS type

  • OLTP and OLAP serve different workload profiles
  • SQL and NoSQL make different trade-offs for different jobs
  • Polyglot persistence separates storage concerns by data contour
  • NewSQL combines a SQL interface with horizontal scaling

📊Indexing

  • B-Tree indexes support range queries and equality predicates
  • Hash indexes target point lookups
  • Composite indexes are sensitive to column order
  • Covering indexes reduce reads from the base table

Scaling

  • Read replicas help scale read-heavy workloads
  • Sharding scales write volume and data size horizontally
  • Partitioning keeps large tables manageable
  • Connection pooling reduces connection overhead: PgBouncer, ProxySQL

🔒Consistency

  • ACID defines baseline transaction guarantees
  • Isolation levels balance correctness and performance
  • Eventual consistency in distributed systems
  • The Saga pattern decomposes distributed transactions into steps

Who is this book for?

For beginners

Students and developers who need a systematic foundation in DBMS concepts

Backend developers

To organize existing experience and fill gaps around SQL, indexes, and transactions

Interview preparation

For calmer conversations about storage choice, consistency, and scaling

About the authors

The book was written by authors from Postgres Professional, a Russian company focused on PostgreSQL-based solutions. The team is known for its PostgreSQL contributions, educational materials, and practical database implementation experience.

What to remember

Guide to Databases is best read as a foundation before more specialized material. It does not replace DDIA or Database Internals, but it gives you a common language for data models, SQL, indexes, transactions, and distributed trade-offs. After it, DBMS choices become easier to justify by constraints instead of habit or tool popularity.

Related chapters

Where to find the book

Enable tracking in Settings