I teach that adding Redis does not automatically make an application faster; the caching strategy should fit the workload.
I cover 8 caching patterns for backend developers and AI engineers.
I recommend Cache-Aside for read-heavy applications: the application checks the cache first, fetches missing data from the database, and updates the cache.
I describe Read-Through as a pattern where the cache automatically retrieves missing data from the database, simplifying application read logic.
I recommend Write-Through when coordinated writes are needed: every write updates the cache and database before completion.
I suggest considering Write-Back for frequent writes: writes go to the cache first and are asynchronously persisted to the database, with durability risks managed.
I describe Write-Around as sending writes directly to the database, bypassing the cache; it suits data rarely accessed again.
I recommend Refresh-Ahead for frequently accessed hot data that needs low read latency; entries are refreshed before expiration.
I describe TTL Expiry as automatically expiring cached entries after a configured duration to limit how long stale data remains cached.
I recommend LRU Eviction for limited cache memory: when capacity is reached, remove the least recently used entries.
I emphasize that TTL and LRU can work alongside Cache-Aside or Write-Through; these mechanisms need not compete.
I consider cache invalidation, consistency, memory usage, and failure recovery just as important as cache hit rate.
I see caching as relevant to AI workloads including RAG retrieval, embeddings, LLM responses, and repeated API requests.
My caching principle is to store the right data at the right time, rather than storing everything.
I described outage week, Nov 12 to 17, as nine major outages in six days across technology, transport, finance, AI, and government services.
I linked many of the incidents to software bugs, updates, aging infrastructure, or data centre failures.
I reported that Outlook, Teams, and Copilot were disrupted worldwide; the stated cause was a latent gateway bug triggered by extra load.
I reported a nationwide FAA ground stop affecting US departures, attributed to high traffic on older FAA network infrastructure.
I reported that Workday HR and payroll services were disrupted for thousands of firms and that the incident affected two data centres.
I reported that AWS us-east-1 sign-ins, sign-ups, and networking were disrupted for around three hours; no public cause was given at the time.
I reported that banking transfers stalled and airline departures were held at JPMorgan Chase and United Airlines; both cited technology issues, with limited technical detail shared publicly.
I reported that model errors, Apple service failures, and a classified-network outage involving Claude, Apple, and the NSA occurred across two days; stated causes included software updates or patches, while some details were not published.
I warned that a small software bug, overloaded gateway, infrastructure dependency, or failed update can affect millions of people within minutes.
- I recommend strong monitoring and alerting; safe deployment and rollback practices; redundancy across critical infrastructure; clear incident communication; and regular testing of failure scenarios.
I believe production systems are judged not only by how they work on a normal day, but by how they recover on a bad one.
I recommend clarifying requirements and constraints before presenting a RAG architecture: system design is about knowing why to choose components, not merely naming them.
- I use requirement questions to establish the data type and size, whether it is structured or unstructured, how frequently it changes, latency and user scale, model restrictions, budget, privacy and compliance requirements, and whether accuracy, latency, or cost matters most.
- I explain how requirements change RAG choices: sensitive data can change model and infrastructure choices; a limited budget may favor open-source models; frequently changing data calls for continuous ingestion updates; critical latency may require retrieval-pipeline optimization; and an accuracy priority may justify more investment in reranking and evaluation.
My recommended interview sequence is: First understand the requirements. Then identify the constraints. Then discuss the trade-offs. And only after that, explain the workflow.
I promote the Interview Kit with the sequence “Learn in depth → Practice → Perform → Crack the job” and the claim “99% confidently”; the post gives no measured interview outcome.
A plausible RAG workflow can include data ingestion, chunking, embeddings, a vector database, retrieval, reranking, an LLM, and response generation. Knowing those components is not enough: I advise asking questions first, understanding the problem and constraints, and only then explaining how to build it.
I describe four rate-limiting algorithms for software and AI engineers, noting that traffic spikes can overload a backend, increase costs, and affect reliability.
- I describe Token Bucket as allowing short bursts while controlling average request rates.
- I describe Leaky Bucket as queuing requests and processing them at a steady rate.
- I describe Fixed Window as simple request counting that can allow bursts at window boundaries.
- I describe Sliding Window as tracking requests over a rolling time window for stricter enforcement.
I recommend choosing a rate limiter based on traffic patterns, backend capacity, and fairness requirements; for AI applications, rate limiting also helps control LLM API usage and inference costs.
I describe a load-balancing example with 3 servers, where one is overloaded while the others are underutilized, and suggest that the algorithm rather than the infrastructure could be the problem.
- I describe Round Robin as distributing requests equally across servers and recommend it when servers have similar capacity.
- I describe Weighted Round Robin as distributing traffic based on server capacity and recommend it when servers have different resources.
- I describe Least Connections as routing requests to the server with the fewest active connections; I recommend it for variable request duration.
- I describe Least Response Time as prioritizing servers responding faster to help reduce latency; I recommend it for latency-sensitive workloads.
- I describe IP Hash as routing requests based on client IP to provide session affinity; I recommend it when session affinity is needed.
- I describe Power of Two Choices as randomly selecting two servers and routing traffic to the less-loaded one.
I emphasize that load balancing is not just about distributing requests; it is about distributing work efficiently. For AI applications, choosing an algorithm can help distribute inference requests, manage GPU workloads, and improve reliability.
I present 20 software architecture patterns and argue that good architecture means choosing the right patterns, rather than using more patterns or applying every pattern known.
- I describe Layered Architecture as separating presentation, business logic, and data layers, and recommend starting with it for a simple application.
- I describe Client-Server as separating frontend clients from backend services.
- I describe Microservices as independently deployable services and suggest considering them when services need to be independent.
- I describe Event-Driven Architecture as connecting components through asynchronous events and recommend it for asynchronous workflows.
- I describe Pipe-and-Filter as processing data through independent stages and recommend exploring it for data pipelines.
- I describe CQRS as separating read and write operations.
- I describe Event Sourcing as storing state changes as a sequence of events.
- I describe the Saga Pattern as coordinating distributed transactions with compensating actions.
- I describe an API Gateway as centralizing API routing, authentication, and traffic management.
- I describe Hexagonal Architecture as separating business logic from external dependencies.
- I describe Serverless as running code on demand without managing servers.
- I describe Space-Based Architecture as using distributed in-memory processing to reduce bottlenecks.
- I describe a Service Mesh as managing communication, security, and observability between services.
- I describe Peer-to-Peer as allowing nodes to communicate without a central server.
- I describe the Broker Pattern as routing communication through an intermediary.
- I describe Master-Worker as distributing tasks across multiple workers.
- I describe the Sidecar Pattern as running supporting services alongside applications.
- I describe Backend for Frontend as building dedicated backends for different clients.
- I describe the Strangler Fig Pattern as gradually replacing legacy applications and recommend considering it for legacy modernization.
- I describe Circuit Breaker as stopping repeated requests to failing services and recommend implementing it for distributed failures.
I identify adding complexity before understanding the problem as the biggest architecture mistake. These patterns also matter for production RAG systems, multi-agent workflows, inference services, and distributed AI applications.
I use architecture patterns as choices guided by production needs: simplicity, independently deployable services, asynchronous workflows, data pipelines, distributed failures, or legacy modernization. My posts also connect these system-design lessons to linkedin profile, where I describe my focus on practical AI systems.
Related: ai engineering fundamentals, ai engineering learning paths, web request lifecycle