Khushal Agrawal

Engineering notes

Build logs, reading notes, and systems essays.

Long-form notes on internals, tradeoffs, failures, measurements, and the useful edges of building infrastructure from scratch.

Mailing list

Get the next note

One email when a new systems note ships. No cadence theater, no recycled thread dumps.

No growth hacks in the inbox. Just the posts. Prefer feeds? Use RSS.

Series

Topics

databases (4) rust (4) systems (4) performance (3) redis (3) distributed-systems (2) linux (2) animation (1) caching (1) concurrency (1) creative-coding (1) ebpf (1) event-loops (1) grep (1) kafka (1) lsm-tree (1) network-programming (1) observability (1) profiling (1) regex (1) scalability (1) state-machines (1) storage (1) storage-engine (1) system-design (1) visualization (1)

All notes

Jul 8, 2026 / 6 min read

Building Broadsheet, a Rust Animation Engine for Systems Explainers

How I built a deterministic Rust animation engine with stateless timelines, camera-aware rendering, newspaper styling, and ffmpeg export.

rustanimationsystemsvisualizationcreative-coding

Jun 20, 2026 / 9 min read

I Built LSM Trees for a Storage Engine

The first notes from building a Rust storage engine: WAL records, skip-list memtables, immutable memtables, SSTable files, block indexes, tombstones, and Bloom filters.

storage-enginelsm-treerustdatabasessystems

Jun 14, 2026 / 6 min read

Building grep in Rust Taught Me to Think in State Machines

Notes from building a grep clone with a custom regex engine: tokenization, Shunting Yard, Thompson-style NFAs, epsilon transitions, and line-by-line matching.

rustgrepregexstate-machinessystems

Jun 10, 2026 / 8 min read

System Design Chapter 1 Notes: How Web Systems Start Scaling

Notes from the first chapter of System Design Interview, covering load balancers, replication, caching, CDNs, sharding, denormalization, sticky sessions, and operational automation.

system-designdistributed-systemsdatabasescachingscalability

Jun 6, 2026 / 6 min read

Building a Redis Clone in Rust, Then Making It 49x Faster With Profiling

Benchmarking a Redis-compatible Rust server against Redis, profiling the slow paths, and using indexes to remove pathological scans.

redisrustperformanceprofilingdatabases

Jun 1, 2026 / 8 min read

Concurrent Servers: Notes on Threads, Event Loops, libuv, Redis, and async/await

A series-level writeup from Eli Bendersky's concurrent servers articles, tracing the design space from sequential sockets to threads, event-driven I/O, libuv, Redis, and async/await.

network-programmingconcurrencyevent-loopsredissystems

May 20, 2026 / 1 min read

Redis Internals: The Event Loop as a Systems Primitive

A concise walkthrough of how Redis uses a single-threaded event loop, multiplexed I/O, and careful data structure choices to stay predictable under load.

redislinuxperformancedatabases

May 13, 2026 / 1 min read

Kafka Architecture Notes: Logs, Segments, and Consumer Lag

Engineering notes on Kafka's log-oriented architecture, segment lifecycle, replication, and why consumer lag is an operational signal rather than just a metric.

kafkadistributed-systemsstorage

May 2, 2026 / 1 min read

eBPF Tracing Notes for Runtime Latency

A practical outline for using eBPF to observe syscall latency, scheduler pressure, and runtime behavior with minimal application changes.

ebpflinuxobservabilityperformance