Friday, June 12, 2026

KaalNiti

Systems · Time · Power · Failure — consequences over intent

— Aniket Pal —

The complete archive

The Builder's Desk

Everything here was built to answer a question, usually the question of what some piece of infrastructure is actually doing when nobody is watching. Click any story to unfold it.

2025 · The Builder's Desk

DevProxy

A high-performance HTTP proxy written in modern C++ — connection pooling, an epoll event loop, and a config language small enough to memorize.

C++17 epoll Sockets CMake

▸ Full story

▾ Fold it back

DevProxy screenshot
[ project screenshot ]

DevProxy is an HTTP/1.1 forward and reverse proxy built from raw sockets up. It runs a single-threaded epoll-based event loop per core, keeps upstream connections alive in a slab-allocated pool, and reloads configuration on SIGHUP without dropping in-flight requests. Structured access logs ship as newline-delimited JSON. Built to understand exactly what nginx does for me — and what it costs.

Further Reading → The Architecture of Failure

2025 · The Builder's Desk

BNS RAG

A biomedical retrieval-augmented generation pipeline that answers clinical questions with citations, not confidence.

Python Ollama ChromaDB FastAPI

▸ Full story

▾ Fold it back

BNS RAG screenshot
[ project screenshot ]

BNS RAG ingests biomedical literature, chunks it with section-aware splitting, embeds passages into ChromaDB, and serves grounded answers through a locally hosted Ollama model. A reranking stage filters retrieved passages before generation, and an evaluation harness scores every answer for citation faithfulness. The reranker cut hallucinated references by roughly 60% in testing.

Further Reading → Flow State

2024 · The Builder's Desk

Distributed Cache

A sharded in-memory cache with consistent hashing, TTL eviction, and a wire protocol you can read with netcat.

C++ Consistent Hashing Gossip TCP

▸ Full story

▾ Fold it back

Distributed Cache screenshot
[ project screenshot ]

A distributed key-value cache where nodes discover each other over a gossip layer and keys are placed via consistent hashing with virtual nodes, so adding a shard remaps only its slice of the ring. Supports per-key TTLs, LRU eviction under memory pressure, and a deliberately plain text protocol for debuggability. The interesting failures were never in the happy path — they were in what happens when a node disappears mid-rebalance.

Further Reading → The Architecture of Failure

2024 · The Builder's Desk

Load Balancer

A Layer 4/7 load balancer with health checks, weighted round-robin, and least-connections scheduling.

C++ Layer 4/7 Health Checks Scheduling

▸ Full story

▾ Fold it back

Load Balancer screenshot
[ project screenshot ]

A load balancer that speaks both raw TCP and HTTP, with pluggable scheduling strategies: round-robin, weighted round-robin, and least-connections. Active health checks eject unhealthy upstreams and readmit them after consecutive successes, with exponential backoff between probes. Built as the natural sequel to DevProxy — once you can move one request, the next question is how to move a million of them fairly.

Further Reading → The Myth of Sisyphus