liveBook · Manning

What you will learn in Latency

Reduce delay in software systems

by Pekka Enberg

Chapter by chapter

Chapter 1: Introduction

1.1 What is latency? · 1.2 How is latency measured? · 1.3 Why does latency matter? · 1.3.1 User experience · 1.3.2 Real-time systems · 1.3.3 Efficiency · 1.4 What latency is not · 1.5 Latency vs. bandwidth · 1.6 Latency vs. energy · 1.7 Summary

What you learn in chapter 1 →

Chapter 2: Modeling and measuring latency

2.1 Laws of latency · 2.1.1 Little’s law · 2.1.2 Amdahl’s law · 2.2 Latency distribution · 2.3 Common sources of latency · 2.3.1 Physics · 2.3.2 CPU and hardware · 2.3.3 Virtualization · 2.3.4 Operating system, drivers, and firmware · 2.3.5 Managed runtime · 2.3.6 Application · 2.4 Compounding latency · 2.5 Measuring latency · 2.6 Putting it together: Measuring network latency · 2.6.1 Plotting with histograms · 2.6.2 Plotting with eCDF · 2.7 Summary

What you learn in chapter 2 →

Chapter 3: Colocation

3.1 Why colocate? · 3.2 Internode latency · 3.2.1 Geographical and last-mile latency · 3.2.2 Edge computing and CDNs · 3.3 Intranode latency · 3.3.1 Network stack · 3.3.2 TCP/IP protocol · 3.3.3 Kernel-bypass networking · 3.4 Multicore architecture · 3.5 Putting it together: REST API with embedded database · 3.6 Summary

What you learn in chapter 3 →

Chapter 4: Replication

4.1 Why replicate data? · 4.2 Availability and scalability · 4.3 Consistency model · 4.3.1 Strong consistency · 4.3.2 Eventual consistency · 4.3.3 Other consistency models · 4.4 Replication strategies · 4.4.1 Single-leader replication · 4.4.2 Multi-leader replication · 4.4.3 Leaderless replication · 4.4.4 Read-your-writes property · 4.4.5 Local-first approach · 4.5 Asynchronous vs. synchronous replication · 4.6 State machine replication · 4.7 Case study: Viewstamped Replication · 4.8 Putting it together: Replicating a key–value store · 4.9 Summary

What you learn in chapter 4 →

Chapter 5: Partitioning

5.1 Why partition data? · 5.2 Physical partitioning strategies · 5.2.1 Horizontal partitioning · 5.2.2 Vertical partitioning · 5.2.3 Hybrid partitioning · 5.3 Logical partitioning strategies · 5.3.1 Functional partitioning · 5.3.2 Geographical partitioning · 5.3.3 User-based partitioning · 5.3.4 Time-based partitioning · 5.3.5 Overpartitioning · 5.4 Request routing · 5.4.1 Direct routing · 5.4.2 Proxy routing · 5.4.3 Forward routing · 5.5 Partition imbalance · 5.5.1 Hot partitions · 5.5.2 Skewed workloads · 5.6 Putting it together: Horizontal partitioning with SQLite · 5.7 Summary

What you learn in chapter 5 →

Chapter 6: Caching

6.1 Why cache data? · 6.2 Caching overview · 6.3 Caching strategies · 6.3.1 Cache-aside caching · 6.3.2 Read-through caching · 6.3.3 Write-through caching · 6.3.4 Write-behind caching · 6.3.5 Client-side caching · 6.3.6 Distributed caching · 6.4 Cache coherency · 6.5 Cache hit ratio · 6.6 Cache replacement · 6.6.1 Least recently used (LRU) · 6.6.2 Least frequently used (LFU) · 6.6.3 First-in, first-out (FIFO) and SIEVE · 6.7 Time-to-live (TTL) · 6.8 Materialized views · 6.9 Memoization · 6.10 Putting it together: In-application caching with Moka · 6.11 Summary

What you learn in chapter 6 →

Chapter 7: Eliminating work

7.1 Ways of eliminating work · 7.2 Algorithmic complexity · 7.3 Serializing and deserializing · 7.4 Memory management · 7.4.1 Dynamic memory allocation · 7.4.2 Garbage collection · 7.4.3 Virtual and physical memory · 7.4.4 Demand paging · 7.4.5 Memory topology · 7.5 Operating system overhead · 7.5.1 Scheduling delay and context switching · 7.5.2 Background tasks and interrupts · 7.5.3 Network stack · 7.6 Precomputation · 7.7 Putting it together: Benchmarking with Criterion · 7.8 Summary

What you learn in chapter 7 →

Chapter 8: Wait-free synchronization

8.1 Mutual exclusion · 8.1.1 Mutexes · 8.1.2 Read–write locks · 8.1.3 Spinlocks · 8.2 Problems with mutual exclusion · 8.2.1 Inefficiency · 8.2.2 Priority inversion · 8.2.3 Convoying · 8.2.4 Deadlocks · 8.3 Atomics · 8.3.1 Atomic operations · 8.3.2 Anatomy of a spinlock · 8.4 Memory barriers · 8.4.1 Types of memory barriers · 8.4.2 Compiler barriers · 8.4.3 Memory reordering example · 8.5 Wait-free synchronization · 8.5.1 Progress conditions · 8.5.2 Consensus number · 8.5.3 Wait-free queues · 8.5.4 Wait-free stacks · 8.5.5 Wait-free linked lists · 8.6 Putting it together: Building a single-producer, single-consumer queue · 8.7 Summary

What you learn in chapter 8 →

Chapter 9: Exploiting concurrency

9.1 Concurrency and parallelism · 9.2 Concurrency models · 9.2.1 Threads · 9.2.2 Fibers · 9.2.3 Coroutines · 9.2.4 Event-driven concurrency · 9.2.5 Futures and promises · 9.2.6 Actor model · 9.3 Parallel processing · 9.3.1 Data parallelism · 9.3.2 Task parallelism · 9.4 Transactions · 9.4.1 Serializability · 9.4.2 Snapshot isolation · 9.4.3 Data anomalies and weaker isolation · 9.5 Concurrency control · 9.5.1 Two-phase locking · 9.5.2 Multiversion concurrency control · 9.6 Putting it together: Sequential vs. concurrent execution · 9.7 Summary

What you learn in chapter 9 →

Chapter 10: Asynchronous processing

10.1 Fundamentals · 10.1.1 Asynchronous vs. synchronous processing · 10.1.2 The event loop · 10.1.3 Challenges · 10.2 Asynchronous I/O · 10.2.1 I/O multiplexing · 10.2.2 Request batching · 10.2.3 Request hedging · 10.2.4 Buffered I/O · 10.2.5 Memory mapping · 10.3 Deferring work · 10.3.1 Task scheduling · 10.3.2 Priority queues · 10.3.3 Work stealing · 10.4 Resource management · 10.4.1 Thread pools · 10.4.2 Memory pools · 10.4.3 Connection pools · 10.5 Managing concurrency with backpressure · 10.5.1 Controlling the producer · 10.5.2 Buffering · 10.5.3 Dropping and rate limiting · 10.6 Error handling · 10.6.1 Partial errors · 10.6.2 Recovery · 10.6.3 Timeouts and cancellation · 10.7 Observability · 10.7.1 Tracing · 10.7.2 Metrics · 10.8 Summary

What you learn in chapter 10 →

Chapter 11: Predictive techniques

11.1 Introduction to predictive techniques · 11.2 Prefetching · 11.2.1 Pattern-based prefetching · 11.2.2 Semantic prefetching · 11.3 Optimistic updates · 11.3.1 Optimistic view · 11.3.2 Synchronizing optimistic updates · 11.3.3 Consistency guarantees · 11.3.4 Error handling and rollbacks · 11.4 Speculative execution · 11.4.1 Incremental computation · 11.4.2 Parallel speculation · 11.4.3 Value prediction · 11.5 Predictive resource allocation · 11.5.1 Overprovisioning · 11.5.2 Prewarming · 11.6 Summary

What you learn in chapter 11 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.