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.
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.
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.
Codd, relationships, keys
1NF → BCNF, denormalization
Entities, relationships, attributes
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.
SELECT, INSERT, UPDATE, DELETE
INNER, LEFT, RIGHT, FULL, CROSS
ROW_NUMBER, RANK, LAG, LEAD
WITH, recursive queries
Part III: DBMS Architecture
DBMS internals: data storage, indexes, buffer cache, transactions, locks and failure recovery.
Pages, heap, TOAST
B-Tree, Hash, GiST, GIN
ACID, isolation levels
Logging, checkpoint
Part IV: Distributed Systems
Replication, sharding, distributed transactions, the CAP theorem, consensus, and modern scaling approaches.
Leader-replica, multi-leader
Horizontal partitioning
Consistency, availability, network partition
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.
MongoDB, CouchDB
Redis, Memcached, DynamoDB
Cassandra, HBase
Neo4j, JanusGraph
Comparing NoSQL database types
Document database
Nested JSON/BSON documents with flexible schema and rich field-level queries.
Examples
Use cases
Data model
JSON/BSON documents
Query pattern
Field queries, indexes
Consistency
Tunable
Transactions
| Characteristic | Key-value | Document database | Wide-column store | Graph database |
|---|---|---|---|---|
| Scalability | Horizontal | Horizontal | Horizontal | Horizontal and vertical |
| Consistency | Eventual | Tunable | Tunable | Strong |
| Schema | Schemaless | Flexible | Flexible | Flexible |
| 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
- Database Selection Framework - Move from fundamentals to practical DBMS selection by workload profile and system constraints.
- Why understand storage systems? - High-level map of storage models and where relational and NoSQL systems fit.
- Introduction to data storage - How storage choices shape API contracts, consistency semantics, and integration patterns.
- Designing Data-Intensive Applications, 2nd Edition (short summary) - Core theory on replication, partitioning, and consistency behind database architecture decisions.
- PostgreSQL: history, architecture and differences - Practical OLTP baseline with strong transaction semantics and mature ecosystem support.
- MySQL: history, storage engines, and scaling - Alternative OLTP path with different operational and scaling trade-offs.
- Replication and sharding - Operational patterns for growth: replication strategy, shard-key design, and rebalancing.
- CAP theorem - Baseline model of availability/consistency trade-offs for distributed databases.
- PostgreSQL from the inside (short summary) - Deep dive into MVCC, WAL, locking, and indexing internals in PostgreSQL.
- Database Internals (short summary) - Storage engine internals and data structures that define latency and throughput behavior.
