Skip to content

Designing Data-Intensive Applications

Designing Data-Intensive Applications

Designing Data-Intensive Applications (DDIA) by Martin Kleppmann is widely regarded as one of the best books on modern distributed systems and data architecture. It is not a book about specific technologies such as Kafka, MongoDB, or Kubernetes. Instead, it explains the fundamental principles that underpin reliable, scalable, and maintainable data systems.


The book explores how modern applications manage data at scale.

It answers questions such as:

  • How do databases actually store data?
  • Why do some databases favour writes over reads?
  • How do distributed databases replicate data?
  • What happens when servers fail?
  • How do systems stay consistent?
  • How can billions of events be processed efficiently?
  • How can distributed systems coordinate safely?

The book is organised around three major themes.

This section examines how databases work internally.

Key topics:

Data Models

Different ways to represent data:

  • Relational databases
  • Document databases
  • Graph databases

Important lesson:

The data model shapes everything else in the system.

For example:

ModelBest For
RelationalStructured business data
DocumentFlexible application data
GraphComplex relationships

Storage Engines

How databases physically store information.

Two major approaches:

Log-Structured Storage

Examples:

  • Cassandra
  • Kafka
  • RocksDB

Characteristics:

  • Very efficient writes
  • Immutable logs
  • Background compaction

B-Trees

Examples:

  • PostgreSQL
  • MySQL

Characteristics:

  • Fast lookups
  • Efficient indexing
  • Mature technology

Important lesson:

Database performance is heavily influenced by its storage engine.

Encoding and Evolution

How data formats change over time.

Examples:

  • JSON
  • Protocol Buffers
  • Avro

Key concept:

Backward compatibility and forward compatibility.

This becomes important when hundreds of services evolve independently.

This is often considered the most valuable part of the book.

The focus shifts from single databases to distributed systems.

Replication

Replication means keeping copies of data across machines.

Benefits:

  • High availability
  • Fault tolerance
  • Read scalability

The book explains:

Leader-Follower Replication

One server accepts writes.

Other servers replicate changes.

Used by:

  • PostgreSQL replication
  • MySQL replication

Multi-Leader Replication

Multiple servers can accept writes.

Advantages:

  • Geographical distribution
  • Better availability

Challenges:

  • Conflict resolution

Leaderless Replication

Used by:

  • Dynamo
  • Cassandra

Characteristics:

  • No single leader
  • Eventual consistency

Partitioning (Sharding)

How data is spread across multiple machines.

Challenges:

  • Balanced distribution
  • Hot partitions
  • Rebalancing

Key insight:

Scalability often depends more on good partitioning than on powerful hardware.

Transactions

One of the strongest chapters in the book.

Many developers think:

Transaction = SQL feature

Kleppmann shows:

Transactions are a mechanism for handling complexity.

Transactions help protect against:

  • Partial failures
  • Concurrent writes
  • Data corruption

The book also explains:

  • ACID guarantees
  • Isolation levels
  • Serializable transactions

and when these guarantees are worth the cost.

This section becomes very relevant to modern event-driven architectures.

Batch Processing

Large datasets processed as jobs.

Examples:

  • Hadoop
  • Spark

Principle:

Process large volumes efficiently without requiring immediate results.

Stream Processing

Data processed continuously as events arrive.

Examples:

  • Kafka
  • Flink
  • Samza

Key idea:

Events become the source of truth.

This concept is foundational for:

  • Event-driven systems
  • Real-time analytics
  • Event sourcing

Data Integration

Modern systems usually contain:

  • Databases
  • Message queues
  • Search indexes
  • Data warehouses

The challenge is ensuring they remain consistent.

This section explains how data flows through an organisation.


The central message of the book is:

Building data systems is primarily about managing complexity, and the most important qualities of a successful system are reliability, scalability, and maintainability.

Kleppmann argues that every data system is ultimately a collection of trade-offs.

When designing systems, you must constantly balance:

  • Consistency vs Availability
  • Latency vs Durability
  • Simplicity vs Flexibility
  • Strong guarantees vs Performance
  • Centralised control vs Distributed autonomy

The book teaches that there is no universally β€œbest” database, architecture, or distributed system design.

Instead, successful architects:

  1. Understand the guarantees provided by different technologies.
  2. Understand the business requirements.
  3. Choose the right trade-offs.

In short:

The goal is not to find the perfect technology. The goal is to understand the characteristics and trade-offs deeply enough to design systems that meet real-world requirements.


This is where DDIA truly stands apart.

Most technical books teach:

  • Frameworks
  • Languages
  • Products

Those become outdated.

DDIA teaches concepts that remain relevant regardless of technology changes.

For example:

Technology ChangesPrinciple Remains
Database vendorsReplication
Message brokersEvent ordering
Cloud providersPartitioning
APIsConsistency
FrameworksFault tolerance

The underlying principles remain the same.


Why It Matters for Modern Architects and Backend Engineers

Section titled β€œWhy It Matters for Modern Architects and Backend Engineers”

If you are building:

  • Microservices
  • Event-driven systems
  • AI platforms
  • Data pipelines
  • SaaS platforms
  • Cloud-native applications

you will eventually face questions such as:

  • Can this service tolerate stale data?
  • Do we need strong consistency?
  • How should we partition data?
  • What happens if the leader node fails?
  • How do we replay historical events?
  • How do we avoid distributed transactions?

DDIA provides the mental framework for answering these questions.


In a single machine, failures are uncommon.

In distributed systems, failures are normal:

  • Network delays
  • Packet loss
  • Node crashes
  • Time drift

The system must expect failure instead of treating it as an exception.

Many engineers initially assume:

β€œI want the latest data everywhere.”

The book shows that achieving this in a globally distributed system is expensive and sometimes impossible.

This leads to understanding:

  • Eventual consistency
  • CAP considerations
  • Consensus protocols

Business logic changes frequently.

Data often lives for decades.

Therefore:

Architecture should prioritise preserving and evolving data correctly.

This is one reason event logs and immutable records are such powerful ideas.


In summary:

DDIA teaches the fundamental principles required to design reliable, scalable, and maintainable data systems by understanding the trade-offs behind storage, replication, partitioning, consistency, and distributed processing.