A database’s behavior depends on decisions hidden beneath its interface: how information is stored, retrieved, and shared across a system. In Database Internals: A Deep-Dive Into How Distributed Data Systems Work, Alex Petrov examines these underlying mechanisms as a way to understand why modern databases differ and how to choose, use, and maintain them.

From storage engines to distributed systems

The book’s first part focuses on storage engines, moving through B-trees, file formats, transaction processing and recovery, and log-structured storage. It also looks at the components that support efficient database files, including page caches, buffer pools, and write-ahead logs, and compares storage approaches and their uses.

How data is coordinated across nodes

The second part turns to distributed systems: failure detection, leader election, replication, consistency, anti-entropy, distributed transactions, and consensus. Together, these topics trace how nodes and processes form communication patterns and how database clusters maintain consistency across distributed storage.

Petrov draws on material from books, research papers, blog posts, and open-source database code, with references listed at the ends of the two parts. The result is a technical guide organized around the systems beneath database behavior, connecting implementation details to the distinctions developers encounter among modern databases.