SoftwareArchitecture
12 items
Series Posts
Part 0A: Neural Networks & The Learning Mechanism
Building deep intuition from first principles — how neural networks actually learn, explained step by step for engineers who want to truly understand the machinery before architecting with it.
Part 0: Redis Deep Dive: From Cache to AI Memory
An extensive 8-part Redis tutorial series written for senior engineers. It follows the story of Maya, a Staff Engineer at GlobalMart, who transforms a struggling monolith into a distributed, AI-powered platform using Redis.
Part 0B: From Sequences to Transformers
The journey from “words in order” to “understanding meaning” — how we taught machines to process language, and why the Transformer changed everything.
Part 1: "The Database Meltdown" — The In-Memory Revolution
Maya faces her first Black Friday at GlobalMart. The relational database is collapsing under read-heavy traffic. We explore the physics of disk I/O versus RAM, the single-threaded event loop architecture of Redis, and implement the Cache-Aside pattern in Spring Boot.
Part 1A: Understanding the LLM Machine
The technical foundations that drive every architectural decision — transformers, embeddings, and tokenization- are explained through the lens of cost, performance, and trade-offs.
Part 2: "Beyond Strings" — The Anatomy of Data Structures
GlobalMart needs a real-time leaderboard. We move beyond simple key-value caching to explore the internal implementations of Redis data structures: Strings (SDS), Hashes (ZipList), Sets, and Sorted Sets (Skip Lists). We build a high-performance leaderboard using Spring Data Redis.
Part 1B: Making Decisions with LLMs
From model selection to production reliability — the decision frameworks that separate prototype AI from enterprise systems.
Part 3: "The Power Outage" — RDB, AOF, and the Persistence Dilemma
A sudden data center failure wipes out ephemeral shopping cart data. We dive deep into the Unix fork() system call, Copy-on-Write (CoW) memory semantics, and the trade-offs between RDB snapshots and AOF logging. We configure a robust mixed persistence strategy.
Part 2A: Production RAG: What Tutorials Don’t Teach You
From naive retrieval to production-grade systems — the architectural patterns, chunking strategies, and retrieval engineering that separate demo RAG from enterprise RAG.
Part 4: "The Memory Limit" — Eviction Policies and Approximated LRU
GlobalMart hits physical RAM limits, causing OOM crashes. We explore memory management, the maxmemory directive, and how Redis uses an ingenious probabilistic approximated LRU algorithm to evict keys without the overhead of a true linked list.
Part 5: "Going Global" — Sentinel, Clustering, and High Availability
A single node is no longer enough. We dissect Master-Replica replication, automatic failover with Redis Sentinel, and the decentralized hash-slot architecture of Redis Cluster. We configure a highly available Spring Boot application.
Part 6: "The Real-Time Pulse" — Redis Streams and Consumer Groups
GlobalMart needs an event-driven order processing system. We explore Redis Streams, comparing them to Pub/Sub and Kafka. We implement durable, at-least-once message delivery using Consumer Groups and XACK semantics.