Jump to ratings and reviews
Rate this book

Latency

Rate this book
Practical techniques for delivering low latency software.

Slow responses can kill good software. Whether it’s recovering microseconds lost while routing messages on a server or speeding up page loads that keep users waiting, finding and fixing latency can be a frustrating part of your work as a developer. This one-of-a-kind book shows you how to spot, understand, and respond to latency wherever it appears in your applications and infrastructure.

In Latency you’ll learn:

* What latency is—and what it is not
* How to model and measure latency
* Organizing your application data for low latency
* Making your code run faster
* Hiding latency when you can’t reduce it

Put simply, latency is the delay between a cause and effect. In practice, too much latency can create problems throughout a software system, ranging from inaccurate calculations and timeouts to impatient users simply abandoning your applications. Latency issues can be challenging to avoid and troubleshoot. This book balances theory with practical implementations, turning academic research into useful techniques you can apply to your projects.

about the book

Latency shows you how to troubleshoot latency issues in existing systems, and how to create low latency systems from the ground up. You’ll discover how your code runs differently on distributed systems, databases, and operating systems, and understand the common latency-causing issues in each situation. Hands-on projects help you apply what you learn.

You’ll write a latency benchmark harness to measure and visualize latency; and use colocation, partitioning, and caching to reduce latency in a REST API. Plus, tips, tricks, and author Pekka Enberg’s personal insights on latency ensure this book will remain a handy reference long after you’ve finished reading!

350 pages, Paperback

Published March 1, 2025

11 people are currently reading
79 people want to read

About the author

Pekka Enberg

2 books7 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
20 (80%)
4 stars
3 (12%)
3 stars
1 (4%)
2 stars
1 (4%)
1 star
0 (0%)
Displaying 1 - 17 of 17 reviews
Profile Image for Christoph Kappel.
491 reviews11 followers
June 5, 2024
A new book in MEAP and the first 59 available pages were phenomenal - content and explanation wise I felt reminded of Designing Data-Intensive Applications and this is an absolute must-read for the tech-savvy folks.

The examples are in Rust, which is also one of my favorite languages and I am absolute curious of the following chapters.
1 review
November 26, 2025
The title of this new book is deceptively simple. Anyone who has spent any amount of time sitting in front of a screen has experienced latency. Latency can be summed up succinctly as the time it takes to serve a request. Another way of stating it is that latency is the time spent waiting for "something" to finish. But what is that "something" exactly? That wait might be for a keystroke to appear on screen, a web page to render or a spinning beach ball to stop when opening a file. This book will help you build an intuition and understanding of what that something actually is. Practically, the aim of this book is how to understand, measure and reason about the sources of latency in a system. The chapters are a fun dive through all the layers that underpin our modern application stacks. The book starts out with some solid comp-sci theory regarding latency and how to measure it. It then moves on to things like networking, HTTP request serving, scaling and its common replication and sharding techniques. Lasstly it drills down into more of the OS internals and bare metal layer which covers such subjects as virtual memory/paging, locking and concurrency. I found this book to be a thoughtful and methodical progression through the subject. It's unusual to see a single topic book about a very complex subject that is written in a style that reads both fresh and accessible. It manages to avoid overly lengthy and dry passages common to many text books while still delivering the same practical knowledge and takeaways. I would categorize this as something of a reference book. The subject, explanations and much of the theory contains many fundamentals about computing in general. I believe there are many who might benefit and enjoy this book, from Front-end and Full Stack Engineers as well as SREs and maybe Technical Managers.
1 review
Read
November 25, 2025
I was one of the reviewers of the MEAP. My team and I worked through the examples of all the chapters and found the explanations and the code examples very helpful. It was even more beneficial for us as we were experimenting writing high performance code with Rust, even though the principles illustrated within the book are performance and low latency best practices and not specific to Rust. Highly recommended!
Profile Image for Valerie Parham-Thompson.
3 reviews
November 28, 2025
Latency, by Pekka Enberg, fills a gap in the performance tuning space. While many authors have written about database tuning, systems tuning, or code optimization, I haven't seen any come together to cover the whole stack in such a comprehensive way, targeting both software engineers and database architects. Enberg brings a wealth of experience tuning distributed systems, formerly at ScyllaDB and now as CTO at Turso (distributed SQLite).

Having a shared vocabulary across database, software, and infrastructure teams is critical when working together to tune latency issues. I've been in many incident rooms where the only report is "the application is slow" and had to unwind a series of questions: What do you mean by slow? Where do you see this? What parts are slow? If everyone in the room had read Enberg's Latency, solving these kinds of incidents would be much faster. As one example, Enberg breaks down network latency (a small but critical part of the stack) into propagation latency, transmission latency, processing latency, and queueing latency. As another, he clarifies the differences between system service time, wait time, and response time. Each of these can point to a different problem to solve. While he provides the basic math when discussing topics like this, it's quickly followed up by a plain-English description.

Being very clear on terminology helps as well when architecting an application. Enberg digs into every bit of the stack: from physics to hardware, virtualization to the operating system, the managed runtime, and the network, application, and data storage layers. For each optimization discussed, he doesn't just provide best practices but rather shares the tradeoffs and decision points. For example, he covers replication from various angles: replication topologies (single-leader, multi-writer, leaderless), staleness vs. speed (synchronous, asynchronous), and distributed algorithms (RAFT, Paxos, Viewstamped).

Each of the concepts is illustrated with a clear example, and the chapter is capped with a use case scenario. Specific examples are given using TigerBeetle, SQLite, and ScyllaDB; while these are indeed database examples, they are presented from the point of view of a database developer, not a database operator. Developing database software requires thinking very hard about how to reduce latency, and whatever software you are writing, you will benefit from the examples. Many of these scenarios include code you can execute to, as he says, "build intuition." These are often using Rust; even though he states that Rust is not critical to low-latency applications, the case is well-made throughout that you might consider it if you have these needs.

Unique to this presentation are sections on predictive techniques (like prefetching data based on user patterns), eliminating work (the fastest way to do something is not to do it), and "hiding" latency when you can't reduce it (sometimes a batch job is just going to have to update a lot of rows). He covers specific methods in these sections that you can incorporate into your application and operational practices, although if he wrote another book with more details around these concepts, I would read it.

A book that covers so much material risks becoming page after page of bulletpointed lists. Enberg avoids this by organizing the concepts by the layers of the stack, summarizing each optimization concisely followed by 1-2 iterations of depth, providing real-world examples, and including tradeoffs to guide decisions. It will be hard to use this guide as a quick fix; you really need to sit with the whole thing end-to-end, but it is worth it. Especially if you are in an incident room with me in the future.

PS Don't skip the Appendix for further reading. Again, this isn't just a list of resources but rather puts each one in context.
1 review
December 16, 2025
A masterclass in systems engineering

The Good:
Enberg fills a critical gap in performance literature by focusing strictly on latency (delay) rather than the usual focus on CPU throughput or bandwidth. The scope is impressive, bridging the gap between low-level hardware concerns (physics, CPU caches, NUMA) and high-level distributed patterns (partitioning, replication, CAP theorem). The "Putting it together" sections at the end of each chapter are excellent, moving beyond theory to build actual tools like partition-aware benchmarks and replicated key-value stores.

The Caveat:
This is not a casual read. It assumes a solid working knowledge of backends and distributed systems and relies heavily on Rust for its code examples. While the principles apply broadly, if you aren't comfortable with systems programming, sections on "wait-free synchronization," memory barriers, and kernel-bypass networking might feel like overkill or be difficult to parse.

Verdict:
If you are building high-frequency trading platforms, real-time gaming systems, or databases, this is an indispensable 5-star manual. For general application developers, it is a solid 4-star deep dive, but be prepared for a steep technical learning curve.
Profile Image for Giuseppe Catalano.
6 reviews
December 7, 2025
"Latency: Reduce Delay in Software Systems" by Pekka Enberg is a practical guide for software developers aiming to optimize latency in applications. Covering foundational concepts, data optimizations like caching and replication, and advanced techniques such as wait-free synchronization and predictive execution, the book offers actionable strategies to reduce and hide latency. With practical examples, hands-on projects, and insights from the author’s expertise in operating systems and distributed systems, it balances theory and practice effectively. Written for developers with backend knowledge, it includes clear explanations, diagrams, and examples in Rust, making it ideal for those working on latency-sensitive or distributed systems. This book is highly recommended for improving performance and efficiency in modern software applications.
3 reviews
December 9, 2025
This book goes over numerous concepts. Which means you will have highlevel overview at best. Often highlights related problems. BUT! It doesn't answer them!
Multiple concepts are recommended based on the simplest possible examples. If you try to use them in production code you might kill your project. Often concepts are described incorrectly or one-sided,
like in ch8 Wait-free synchronization and ch9 Exploiting concurrency.
I see this book got mostly very positive feedback I think it is mostly by people who don't write code.

I would not recommend this book to PRO developers, as they looking for deep knowledge that they can use in their projects.
For beginners, you must avoid this book, as you don't know what is correct and what is not! And you might start applying something that will hurt your project.
3 reviews1 follower
December 2, 2025
Amazing book on distributed system, providing great insights into where time is spent and what can influence response time. Learn a lot with this book about topics usually only learned with long years of experience and trial error.

I have applied some of that knowledge at work and made me a more confident at designing and improving systems.

It is easy to read, with great real world examples.

Not a newbie book. More suited for mid to senior level engineers. It requires knowledge of some complex topics, such as network protocols, databases and distributed concerns.
1 review
December 11, 2025
The performance book I wish I had five years ago

As a Senior Engineer working on high-throughput systems, I found this book exceptionally practical. Pekka builds from first principles: modeling and measuring before optimizing. This mirrors how experienced engineers actually approach performance problems.
The chapters on caching, partitioning, and lock-free concurrency are particularly valuable. Rust examples are precise and force clarity around memory and concurrency.
Recommended for any engineer serious about performance work.
1 review
November 28, 2025
As someone who teaches systems and sees how little students learn about latency in traditional CS programs, I found this book exceptionally valuable. It explains latency from first principles and shows why it matters in real-world applications. The blend of clear explanations and practical techniques makes it stand out. This is the kind of book I wish every software engineer—and every university course—would include.
227 reviews15 followers
November 29, 2025
For me this has been the best and most enjoyable tech-book I've read this year. It takes a very holistic approach on sources and remediations/workarounds in the field of latency backed by examples in Rust. This is the first book of its kind where this kind of knowledge which is often smeared out over various other sources is condensed specific to the problem (e.g. language, os, device drivers, ... ) nto a single comprehensive work focusing on this domain.
4 reviews
December 2, 2025
Latency isn’t just about faster code: it’s about understanding where delay hides — in I/O, locking, data layout, async boundaries, caching. This book exposes those hidden costs and offers concrete strategies to address them.

The author’s experience in OS and distributed systems shows, and the combination of theory + practical Rust examples hits the sweet spot. For backend developers, it’s a great investment if you care about performance.
This entire review has been hidden because of spoilers.
2 reviews
December 3, 2025
The latest book on latency just released in November 2025 by Pekka Enberg is a good book and perhaps a must-read for tech enthusiasts, especially in 2026. The code also uses rust. In my opinion, this is quite a deep dive in discussing latency, consisting of 4 parts from basic latency, data, compute, to how to hide latency. There are many things discussed in this book. And I think this book is straight to the point. So, software engineers need to read this book to develop low latency systems.
1 review
January 5, 2026
A great collection of useful information for everyone who has to fix the issue of slow response in their systems.
The author goes from the basis, explaining what latency is, and why it matters (sometimes even more than you might think) right to the different ways to solve it, depending on the specific problem at hand.
The book provides a good balance between theory and practical tips, talking about things one need to consider to optimize the system.
1 review
January 6, 2026
This is a practical, comprehensive guide for software engineers who need to make their systems faster. It moves beyond just "making code run fast" and focuses specifically on delay, waiting for networks, disks, or busy CPUs.
13 reviews
November 25, 2025
The book does a good job of explaining real latency issues and goes beyond the basic concepts.
Profile Image for Andrzej Grzesik.
51 reviews6 followers
December 26, 2025
Very good explanations, very clear examples.
I wish it was longer.

Can safely recommend to anybody looking for an intro/overview.
Displaying 1 - 17 of 17 reviews

Can't find what you're looking for?

Get help and learn more about the design.