-
Book Overview & Buying
-
Table Of Contents
Systems Programming with Zig
By :
The design of a high-performance in-memory cache server represents a quintessential challenge in systems programming, requiring a balance between raw throughput, predictable latency, and memory efficiency. In modern distributed architectures, the cache often serves as the primary defense against database bottlenecks, making its internal implementation a critical factor in overall system reliability. By the end of this chapter, you will have built zcache — a non-trivial cache server that demonstrates the core techniques: a custom binary protocol, a Least Recently Used (LRU) eviction policy, TTL-based expiry and a thread-per-connection networking layer, tested by three purpose-built clients that verify correctness, exercise the command interface, and measure throughput. Production cache servers such as Redis, memcached and KeyDB build on these same foundations but add sharded locking, graceful shutdown, Transport Layer...