Microservices and Distributed Systems
From nodes, messages and the fallacies of distributed computing to microservices, sagas, event-driven architecture, event sourcing, messaging, stream processing and scaling, the subject as told through the free samples of the Leanpub books about it.
Created from the free samples of 10 Leanpub books and the descriptions and tables of contents of 16 more books and courses, with every source cited.
A distributed system, in the definition adopted by the introductory book on this shelf, is one whose components are located on different networked computers and communicate and coordinate their actions by passing messages to one another.[1] Microservices are the best-known way of building an application as such a system: an architectural style in which an application is composed of small services that are deployed independently, each organised round one capability of the business and owned by one team.[2]
The two halves of the subject pull against each other. Distribution buys performance, the capacity to grow and the ability to survive failures, and the books about it are largely about what it costs: one lists the false assumptions that programmers bring from single computers, beginning with the belief that the network is reliable.[1] The books about microservices promise speed of delivery and warn of traps; a course on them says that the ideas at the root sound simple and that the approach is not.[13] A book that follows one company through every stage of growth takes as its motto that no architecture is right or wrong, only suited or unsuited to its context.[3]
This article covers where to begin, the history, the fundamentals of distributed systems, microservices, consistency of data across services, events, messaging and streams, distributed data, and scaling and system design. Its sources are the free samples of the Leanpub books listed at the end, with the descriptions and tables of contents of the books and courses whose samples were not available, and every claim that rests on a source is cited to it.
Where to start
For the principles, Distributed Systems for practitioners (2021) is written for software engineers with little or no experience of distributed systems and assumes none of the concepts.[1] The Scaling Playbook is a book about thinking and not about code, for developers who want the larger picture, technical leads and founders,[3] and System Design (2024) is a reference to the fundamentals of system design from networking upwards.[8]
For microservices themselves there are Microservices (2020), a short guide to their design,[2] the course Microservices Masterclass,[13] and two long practical books tied to particular platforms, Spring Boot Microservices in Production (2025) and Cloud Native Microservices With Kubernetes (2024).[14][15]
Readers who have services and now have problems of data should go to Microservice Transaction Patterns (2020), which is very short,[16] and those moving to events have Effective Kafka (2021) on the architecture and its principal tool,[17] and Understanding Eventsourcing (2025), the most widely sold of the core books, on planning and building systems from events.[4]
History
The theory is older than the practice. The ordering of events without a shared clock, agreement among machines that may fail, and the limits on what a system can guarantee when its network is partitioned were worked out in research papers from the late 1970s onwards. Through the 1990s and 2000s industry tried distributed objects and then service-oriented architecture, and the large internet companies published accounts of the storage and processing systems they had built from thousands of cheap machines, which open-source projects then imitated. The word microservices became current in the early 2010s for a lighter version of service orientation that containers and automated delivery had made practical, and the distributed log, a durable and replayable record of events, became the usual means of connecting such services.
The books carry pieces of this. Distributed Systems for practitioners notes that the field has advanced through a great many papers, each building on the last, which sets a high barrier for practitioners, and that the well-known list of fallacies was compiled by engineers at a computer manufacturer to warn newcomers.[1] Camel Design Patterns (2016) appeared, as its foreword says, a decade after the catalogue of integration patterns that inspired the framework it uses, and its author observes that patterns evolve, so that one generation's pattern can be the next one's anti-pattern.[5] Microservices calls microservices the first architectural style developed after continuous delivery,[2] Understanding Eventsourcing dates the arrival of event sourcing in the industry to about 2006,[4] and Effective Kafka describes a decade in which microservices displaced monoliths and practitioners converged on event-driven architecture.[17]
The fundamentals of distributed systems
Distributed Systems for practitioners sets out to give working engineers the basic building blocks, so that they can be confident in the systems they build without any ambition to invent algorithms: what can and cannot be achieved, the basic algorithms and protocols with diagrams, the thinking behind design decisions, and the removal of confusion round terms such as consistency. It calls the components nodes, whatever they are, and stresses two things in its definition: the parts are separated by a network, and they communicate by exchanging messages across it.[1]
The benefits, it says, lie in three areas. Performance: a single computer has physical limits and becomes extremely expensive to improve beyond a point, while several modest machines can do the same work for less. Scalability: data and processing can be divided among machines, to sizes unimaginable for one. Availability: a service that claims five nines works normally 99.999 per cent of the time and so may be down for about five minutes a year, which no single machine can promise; the usual mechanism is redundancy, the storing of data on several machines, and a system that does that is already distributed. There is tension among these benefits and other properties, so that most designs are trade-offs.[1]
The fallacies are eight assumptions carried over from single machines: that the network is reliable, that latency is zero, that bandwidth is infinite, that the network is secure, that its topology does not change, that there is one administrator, that transport costs nothing and that the network is homogeneous. The book adds that technology encourages some of them. Protocols make the network look reliable when it is not, and libraries that present a remote call as a local one conceal a difference of several orders of magnitude, between the nanoseconds of a memory access and the milliseconds of a call to another machine, which grows again between continents. Bandwidth has improved greatly, but a connection that is fast inside a data centre is not so once traffic crosses the internet; the wider network is not under the control of the two nodes that use it and must be treated as insecure; and moving data between two points costs money, which belongs in the design.[1] Designing Distributed Systems (2020) is a short book for students and professionals on designing and maintaining distributed applications,[11] and P2P Networks explains how networks of peers scale to millions of participants without any central coordinator, from file sharing through voice calls to blockchains.[12]
Microservices
Microservices gives the motive first: a business must iterate and release quickly, and microservices, unlike a monolithic application, separate the cycles of change, so that small, cohesive and well-tested components can go to production often. It then lists the characteristics of the style. Services are independently deployable components running in their own processes, whose interactions are defined by contracts. They are organised round business capabilities, ideally with the boundaries of services and of teams coinciding. They are products and not projects: the team owns a service for its whole life, in development and in support. Logic belongs in the services and not in the mechanism that connects them. Governance is decentralised, so that teams are not held to one set of internal standards, and so is data, which is spread across services with a tendency towards eventual consistency. Testing and infrastructure are automated. The remaining chapters take up the gateway in front of the services, the discovery of one service by another, the granularity of interfaces, security, persistence, testing, deployment and monitoring, and one is headed governance and social engineering.[2]
The other books are more guarded. Microservices Masterclass is a course on what microservices are and are not and on the traps that must be avoided to gain their benefits.[13] The Scaling Playbook has a chapter on when they are needed and when they are not, placed halfway through a story that begins with a shop on a content management system; its second principle is to migrate and not to rewrite, since wholesale rewrites often fail, and its fictional company keeps the old system for its content, builds a new back end for the core of the shop and moves one feature at a time.[3] Spring Boot Microservices in Production likewise begins with incremental migration from a monolith and a database for each service,[14] and Cloud Native Microservices With Kubernetes is on deploying, scaling and observing services on a container orchestrator.[15]
Consistency across services
Once each service has its own data, an operation that touches several can no longer be a single database transaction. Microservice Transaction Patterns presents five patterns for keeping data consistent across services that call each other synchronously or asynchronously, and says plainly whom it is for: those who care a great deal about consistency, as in financial services or payments.[16] The commonest answer is the saga, a sequence of local transactions with compensating actions for failures, to which The Scaling Playbook gives a chapter;[3] Event Driven Architecture with Spring Boot 4.x and Kafka 4.x treats it together with the outbox pattern, which makes the writing of data and the publishing of an event succeed or fail together,[18] and System Design Mastery - Advanced poses the choice between a saga and a two-phase commit as one of its questions of trade-off.[22]
Events
In an event-driven architecture services announce what has happened and other services react, instead of calling one another directly. Effective Kafka presents this as a sustainable way of dealing with complexity, integrating systems without increasing their coupling, and teaches it through the most widely used distributed log.[17] Event Driven Architecture with Spring Boot 4.x and Kafka 4.x warns in its description that the architecture is how modern systems scale and also how they fail silently when it is done wrong, and goes from the internals of the log to the patterns built on it.[18]
Event sourcing goes further and makes the record of events the primary store, from which the current state is derived. Understanding Eventsourcing couples it with a method of planning. Its author, after twenty years in which software development seemed as hard as ever, repeats a client's comparison of developers to a pizza delivery, always late, bringing half of what was promised and never as good as the picture, and argues that the root of many failures is the lack of a common language between a business and its developers, more than any technical fault. Event modelling, in which a system is laid out as a sequence of events that everyone can read, supplied that language: the author describes being able, for the first time, to discuss with customers the problems that troubled them without technical terms they neither understood nor cared about, and credits the ideas to others, among them the writers on domain-driven design. The book plans an example, builds it slice by slice, and ends with patterns of implementation, among them read models kept in a database, snapshots and the handling of breaking changes.[4] Event Sourcing in Python offers a pattern language in three parts, an event-sourced domain model, an application, and a reliable distributed system made from several such applications, with working examples throughout.[19]
Messaging, integration and streams
Camel Design Patterns is a catalogue of twenty patterns for integration applications. Whatever the language, the kind of endpoint or the architecture, its introduction says, the same patterns and principles recur under different names, messaging patterns, cloud patterns, microservices patterns, resiliency patterns, and what matters is to know them, to understand their costs and benefits and to decide accordingly. The author found them by noticing the same solutions in tens of projects and only then matching them to patterns already described, and holds that there are no best practices, only good practices in a context; the foreword singles out the patterns for handling errors.[5] NNG Reference Manual (2018) is the reference manual of a lightweight messaging library that needs no broker,[20] and the adjacent Enterprise Integration Platform covers the platforms with which large organisations connect their systems.[25]
Reactive Spring (2022) starts from the limits of traditional input and output: work that waits on the network occupies threads, threads are expensive, and even if they were not, networks are faulty in subtle ways that conventional abstractions hide.[21] Stream Processing: Hands-on with Apache Flink (2024) is on the continuous processing of events, for uses such as recommendations, the monitoring of sensors and the detection of fraud. It describes the layers of a streaming architecture, storage, processing engine, analytical store and table format, and the relation of streams to batches: a batch can be regarded as a special kind of stream, and where an older design ran a fast approximate streaming layer beside a slower correct batch layer, newer ones treat everything as a stream while still allowing history to be queried. Even where batch pipelines are adequate, the book argues, thinking in streams and processing incrementally lowers the costs of maintenance and operation and shortens the time to an updated result from days to hours or minutes.[6]
Distributed data
The Apache Ignite book (2025) is a guide to an in-memory platform that serves as distributed database, cache and computing grid, and recommends its chapter on architecture to anyone who has never worked with a distributed system: nodes that share nothing, the topology of a cluster, the distribution of data by hashing, replication and durable memory. Other chapters use the cache to speed up existing web applications without changing their code and run computations in parallel across the cluster.[7] Two adjacent books approach the same matters from single products: Lift the Elephant, a playbook from the scaling of one company's relational database, starts from the observation that the tuning of queries is the easiest lever and is not enough once a database has grown, and reaches standby servers, read replicas, the forms of replication, arrangements in which several servers accept writes, and partitioning,[9] and Rust Projects - Write a Redis Clone builds a small in-memory data store from nothing, from accepting a connection and serving many clients to the expiry of keys and a design based on actors.[26]
Scaling and system design
The Scaling Playbook tells its story in five parts, from foundations through the separation of front end and back end, caching and the scaling of the database, then microservices, then orchestration, observability and automated delivery, and finally several regions. It promises no tutorials or installation guides and offers instead the reason an architecture suits one stage and not another. Its first principle is to begin with the simplest thing that could work: the founders, three people with a month and almost no money, reasonably chose an off-the-shelf shop, and the question once it had grown was not whether that product was good but whether it still suited the next stage. By then pages took several seconds to load, because each made dozens of queries; every new feature needed an extension, and the extensions conflicted; and each update was a risk. The answer, the book says, depends on the expected rate of growth, the degree of customisation needed, the people, money and time available and the risk the business will bear.[3]
System Design defines system design as the process of defining the architecture, interfaces and data of a system that meets specific requirements, important because such decisions come early and are hard to correct later, and begins at the bottom, with addresses on a network.[8] System Design Mastery - Advanced is the advanced half of a series in case studies and trade-offs, and System Design Mastery - Foundation the introductory half.[22][23] On operation, Rethinking OpenTelemetry Tail-Based Sampling starts from the cost of collecting and storing every trace in a system of many services and proposes an event-driven way of deciding which to keep,[24] and the adjacent Building Software Platforms (2022), for engineering leaders, is on internal platforms that hide such complexity from the developers who use them. Its introduction holds that the sole purpose of enterprise software is to produce value for a business at the lowest cost, value measured by how it helps people get things done, and that the long trend of the industry is towards the commoditisation of nearly everything done with a computer.[10]
Questions about Microservices and Distributed Systems
Which book on microservices should I start with?
For microservices themselves there are Microservices (2020), a short guide to their design, and the course Microservices Masterclass, on what microservices are and are not.[2][13] For the principles underneath, Distributed Systems for practitioners (2021) is written for software engineers with little or no experience of distributed systems.[1] The Scaling Playbook is a book about thinking and not about code, for developers who want the larger picture, technical leads and founders.[3]
What is a distributed system?
A distributed system is one whose components are located on different networked computers and communicate and coordinate their actions by passing messages to one another, the definition adopted by Distributed Systems for practitioners (2021).[1] Its benefits lie in performance, scalability and availability: several modest machines can do the work of one very expensive one, data and processing can be divided among machines, and redundancy, the storing of data on several machines, gives an availability that no single machine can promise.[1] There is tension among these benefits and other properties, so that most designs are trade-offs.[1]
What are the fallacies of distributed computing?
They are eight assumptions carried over from single machines: that the network is reliable, that latency is zero, that bandwidth is infinite, that the network is secure, that its topology does not change, that there is one administrator, that transport costs nothing and that the network is homogeneous.[1] The list was compiled by engineers at a computer manufacturer to warn newcomers.[1] Technology encourages some of them, since libraries that present a remote call as a local one conceal a difference of several orders of magnitude between a memory access and a call to another machine.[1]
Should I rewrite a monolith as microservices?
The Scaling Playbook makes it a principle to migrate and not to rewrite, since wholesale rewrites often fail.[3] Its fictional company keeps the old system for its content, builds a new back end for the core of the shop and moves one feature at a time, and the book has a chapter on when microservices are needed and when they are not.[3] Spring Boot Microservices in Production (2025) likewise begins with incremental migration from a monolith and a database for each service.[14]
What is the saga pattern?
Once each service has its own data, an operation that touches several can no longer be a single database transaction. The commonest answer is the saga, a sequence of local transactions with compensating actions for failures, to which The Scaling Playbook gives a chapter.[3] Event Driven Architecture with Spring Boot 4.x and Kafka 4.x treats it together with the outbox pattern, which makes the writing of data and the publishing of an event succeed or fail together.[18]
What is the difference between event-driven architecture and event sourcing?
In an event-driven architecture services announce what has happened and other services react, instead of calling one another directly. Event sourcing goes further and makes the record of events the primary store, from which the current state is derived. Effective Kafka (2021) teaches the first through the most widely used distributed log, and Understanding Eventsourcing (2025) couples the second with event modelling, in which a system is laid out as a sequence of events that everyone can read.[17][4]
Sources
Every source is a Leanpub book or course. The note after each says which part of it was read; where no sample was available, only the public description and table of contents were used.
- 1.Distributed Systems for practitioners, Dimos Raptis Free sample: the preface and the opening chapter, on what a distributed system is and the fallacies. 2021. Free sample: PDF · EPUB
- 2.Microservices, Rohit Kelapure: A Pragmatic Approach Free sample: the contents and the opening chapters, on motivation and the characteristics of the style. 2020. Free sample: PDF
- 3.The Scaling Playbook, Andie Nguyen Free sample: the contents, the introduction and the first chapter. 2026. Free sample: PDF
- 4.Understanding Eventsourcing, Martin Dilger: Planning and Implementing scalable Systems with Eventmodeling and Eventsourcing Free sample: the contents and the opening chapters, on why the author cares. 2025. Free sample: PDF
- 5.Camel Design Patterns, Bilgin Ibryam: Patterns, Principles, and Practices for Designing Apache Camel Applications Free sample: the foreword and the introduction. 2016. Free sample: PDF · EPUB
- 6.Stream Processing: Hands-on with Apache Flink, Giannis Polyzos Free sample: the opening chapter, on streams and streaming architectures. 2024. Free sample: PDF · EPUB
- 7.The Apache Ignite book, Shamim Bhuiyan: The next phase of the distributed systems Free sample: the preface, with its chapter-by-chapter outline. 2025. Free sample: PDF · EPUB
- 8.System Design, Karan Pratap Singh: Learn how to design systems at scale and prepare for system design interviews Free sample: the opening pages, on what system design is, and the first chapter. 2024. Free sample: PDF
- 9.Lift the Elephant, Alex Yarotsky: Scaling PostgreSQL Beyond Query Optimization Free sample: the table of contents and the introduction. 2026. Free sample: PDF
- 10.Building Software Platforms, Pablo Bermejo Free sample: part of the introduction. 2022. Free sample: PDF · EPUB
- 11.Designing Distributed Systems, Joseph Thachil George: Distributed Systems The free sample holds almost no text: from the description. 2020. Free sample: PDF
- 12.
- 13.Microservices MasterclassCourse, David Farley, CourseAI No sample: from the description and outline of the course. 2026.
- 14.Spring Boot Microservices in Production, Enrique Medina Montenegro: A comprehensive guide to building, deploying, and scaling resilient distributed systems with Spring Boot and Spring Cloud No sample: from the description and table of contents. 2025.
- 15.Cloud Native Microservices With Kubernetes, Aymen El Amri: A Comprehensive Guide to Building, Scaling, Deploying, Observing, and Managing Highly-Available Microservices in Kubernetes No sample: from the description and table of contents. 2024.
- 16.Microservice Transaction Patterns, guypardon: For The Enterprise No sample: from the description and table of contents. 2020.
- 17.Effective Kafka, Emil Koutanov: A Hands-On Guide to Building Robust and Scalable Event-Driven Applications with Code Examples in Java No sample: from the description and table of contents. 2021.
- 18.Event Driven Architecture with Spring Boot 4.x and Kafka 4.x, Umur Inan No sample: from the description and table of contents. 2026.
- 19.Event Sourcing in Python, John Bywater: Event-oriented analysis and design with applications No sample: from the description and table of contents. 2026.
- 20.NNG Reference Manual, Garrett D'Amore No sample text was extracted: from the description and table of contents. 2018.
- 21.
- 22.System Design Mastery - Advanced, Sameer Paradkar: Case Studies, Trade-offs & Scenarios No sample: from the description. 2026.
- 23.System Design Mastery - Foundation, Sameer Paradkar: Case Studies, Trade-offs & Scenarios No sample: from the description. 2026.
- 24.Rethinking OpenTelemetry Tail-Based Sampling, Stephen S. P. Tsoi: An Event-Driven Alternative to Two-Tier Collector Architectures No sample: from the description and table of contents. 2026.
- 25.Enterprise Integration Platform, Sameer Paradkar: Foundations • Principles • Patterns No sample: from the description and table of contents. 2026.
- 26.Rust Projects - Write a Redis Clone, Leonardo Giordani: Explore asynchronous programming with the actor model using Rust and Tokio No sample: from the description and table of contents. 2026.
Further reading
Other books in the library on neighbouring ground, not cited above.
- Ansible for Kubernetes, Jeff Geerling: Automate app deployment on any scale with Ansible and K8s Automating a container orchestrator, from building clusters to deploying applications on them. 2020.
- Development & Deployment of Multiplayer Online Games Vol. I, 'No Bugs' Hare: GDD, Authoritative Servers, Communications The first volume of a series on the architecture of multiplayer online games. 2017. Free sample: PDF
- Coding an Architecture Style, Enrique Pablo Molinari: A practical guide to learn Software Architecture by coding in Java One application taken through several architecture styles in turn. 2020. Free sample: PDF · EPUB
- Architecting Scalable Solutions: A Practical Approach to Software Design, Alon Fliess: Designing Scalable, Maintainable, and Future-Proof Software Solutions A general book on software architecture, with microservices among its subjects. 2026.
- DDD with Spring Boot, Enrique Medina Montenegro: Implementing Robust, Scalable Applications Using Strategic and Tactical DDD Patterns Strategic and tactical domain-driven design on one Java framework. 2025.
- How Query Engines Work, Andy Grove: An Introductory Guide The concepts behind query engines, shown by building one. 2026.
- Build APIs You Won't Hate: Second Edition, Phil Sturgeon: Roughly 80% of the internet is roughly built APIs, held together with enough duct-tape to choke all the hamsters powering it. Let's learn how to build them properly. The practices of designing and building interfaces between services. 2025. Free sample: PDF · EPUB