Kubai Kevin

75 articles tagged Redis

Distributed locks: safe only with fencing

A lease can expire while its holder is still running. Fencing tokens, enforced by the protected resource, are what make a distributed lock safe.

17 min read · 13 November 2026

Virtual threads: what actually changes

What virtual threads change in a blocking Java service, where the real bottleneck moves, how pinning and thread-locals bite, and how to measure it.

15 min read · 13 November 2026

Redis vs Valkey vs Dragonfly: which in-memory store?

A mechanism-first guide to picking Redis, Valkey or Dragonfly: fork history, single-thread limits, expiry semantics, migration tests and metrics.

17 min read · 7 November 2026

Rate limiters: burst vs abuse, two designs

Two rate limiter designs compared: token bucket with concurrency cap versus sliding window with penalty box, plus how to tune and measure each.

15 min read · 11 October 2026

Portfolio projects hiring managers skip

Portfolio projects often fail screening for legibility, not code quality. Here is how to restructure a repo so a reviewer understands it fast.

19 min read · 25 September 2026

Tool calls: why retries stampede

Why per-client backoff fails under fan-out tool use, and how shared token buckets, single-flight and one-layer retries fix it.

12 min read · 22 September 2026

Dead-letter queues: stop poison messages

Design retry caps, DLQs, and alerts so a poison message is isolated in seconds. Includes working Redis Queue code and pytest tests.

15 min read · 21 September 2026

Context windows: agents that run for days

Long-running agents fail when context is treated as a log. Keep constraints verbatim, checkpoint durable state, and cap the working set per cycle.

17 min read · 19 September 2026

Multi-agent systems: why failures hide

Why multi-agent LLM pipelines fail silently, and how per-agent tracing, schema validation, budget enforcement, and loop detection make those failures loud.

13 min read · 18 September 2026

Which agent stack survives 3G?

How edge-deployed and centralised agent stacks behave on high-latency, lossy mobile links, and how to measure reconnection storms before choosing one.

13 min read · 16 September 2026

Self-service AI tooling: where it breaks first

Self-service AI platforms fail on shared keys, missing cost ceilings and model drift. How to spot each pattern, instrument it, and fix it at the gateway.

15 min read · 16 September 2026

Memory Systems for Production Agents

How in-memory stores, caches, and stateful services leak context in production agents, plus code, failure modes, and instrumentation to measure it yourself.

11 min read · 15 September 2026

Stop assuming payment APIs never fail

How to combine AI recommendations with M-Pesa, Paystack and Flutterwave calls so gateway timeouts, rate limits and duplicate charges don't break checkout.

13 min read · 13 September 2026

Thundering Herd: The Hidden Scaling Trap

Why synchronized cache misses and naive retries collapse services, and how coalescing, jittered backoff, and locks prevent self-inflicted overload.

12 min read · 10 September 2026

Hybrid Cloud Routing: Cost-Speed Balance for SEA

How SEA teams route latency-sensitive traffic locally and bursty workloads to the cloud, with Nginx fallback config, failure modes, and cost checks.

13 min read · 4 September 2026

Why your routing layer will collapse at scale

How to build stateful, region-aware LLM routing: config schema, retry budgets, circuit breakers, audit trails, and the failure modes to plan for.

12 min read · 4 September 2026

Portfolio projects that hire remote senior devs

Build a portfolio that proves operational rigor: caching, rate limiting, observability, and load tests that survive a senior remote technical screen.

14 min read · 3 September 2026

IDP for AI: 2026 stack evolution

How to wire embedding model changes into an internal developer platform so dimension drift fails loudly instead of silently shipping broken indexes.

14 min read · 2 September 2026

Only boring stacks survive AI services

Why monoliths beat microservices for solo AI builders, how to spot the "one more abstraction" trap, and how to measure when vertical scaling stops working.

16 min read · 31 August 2026

Prevent ownership drift when velocity explodes

How to keep clear ownership of caches, SLOs and services when teams ship faster: deployment boundaries, error budgets, stampede locks and useful telemetry.

15 min read · 29 August 2026

AI features rot faster than you build them

Model APIs, prompts and schemas change under you. Here is how to make AI feature contracts explicit, versioned and reversible without a rewrite.

15 min read · 27 August 2026

AI on slow networks: Nairobi teams' 2026 playbook

How to cut perceived AI latency with multi-tier caching, stampede guards, and edge orchestration, plus how to measure each layer yourself.

13 min read · 26 August 2026

Validating AI-Generated Code Before It Reaches Production

AI-written code often fails quietly under load. Here is how to validate it at build time, guard it at runtime, and keep on-call triage fast.

10 min read · 20 August 2026

Evolve your monolith without rewriting in 2026

A three-layer FastAPI layout (API, domain, infra) that keeps a monolith evolvable: worked code, failure modes, cache stampede fixes, and how to measure.

15 min read · 19 August 2026

Replace managed services with Postgres 17

How to decide whether to replace managed cache, search, and scheduler services with Postgres extensions, and how to measure the trade-off honestly.

14 min read · 16 August 2026

AI-era promotions hinge on this one thing

AI features fail through cache eviction, schema drift and missing rollback paths. A practical guide to validation gates, fallback caches and metrics.

11 min read · 15 August 2026

Rust SDK vs FastAPI for LLM ops: trust in 2026

How to compare a compiled Rust inference service against a Python async API for LLM serving: cold starts, cache stampedes, memory, and how to measure each.

10 min read · 14 August 2026

Senior engineer title inflation in 2026

How AI-generated code changes senior-engineer expectations: residency-aware LLM gateways, retry budgets, audit logs, and verification you can run.

11 min read · 13 August 2026

Spot evictions: the retry logic that holds up

Spot evictions break naive retry logic. Learn how to decouple retries from instance lifecycle, add jitter, and avoid coordinated retry storms.

13 min read · 12 August 2026

Agent SLOs: measure what agents actually do

Latency and 5xx SLOs miss stuck loops. Define outcome SLOs on completion rate, with schema, PromQL, and failure handling.

13 min read · 11 August 2026

Orchestration tax kills multi-agent systems

Why coordination layers dominate multi-agent latency and memory, with patterns that remove the scheduler and how to measure your own orchestration tax.

13 min read · 11 August 2026

Designing APIs for High-Latency Satellite Links

How to keep an API reliable over high-latency satellite links: circuit breakers, retry budgets, failover gateways, and the metrics that show what broke.

14 min read · 10 August 2026

Cost-Effective AI Infrastructure for Micro-SaaS

How to architect an AI micro-SaaS on a tight budget: caching, batching, serverless scaling, cost measurement, and the failure modes that break naive designs.

15 min read · 5 August 2026

Senior role projects: 3 real paths

Build three portfolio projects that demonstrate tenant isolation, retry-storm handling, and event sourcing, with concrete ways to measure each claim.

16 min read · 5 August 2026

Supervisor vs swarm vs debate vs pipeline

Compare four multi-agent orchestration patterns: supervisor, swarm, debate, and pipeline. Covers failure modes, backpressure, retries, and how to measure each.

19 min read · 3 August 2026

Designing Reliable Webhook Pipelines for African Payment APIs

How to build idempotent, resilient webhook pipelines for M-Pesa, Paystack and Flutterwave APIs, including retries, deduplication and failure modes.

12 min read · 1 August 2026

Built a multi-agent system without LangGraph

Build a multi-agent research pipeline with Redis Streams, Step Functions retries and FastAPI, plus the failure modes that matter and how to measure them.

13 min read · 27 July 2026

Context windows live longer than you think

Long-running agents exhaust context windows through unbounded history growth. Covers pruning, summarisation, retrieval, and retention policies with code.

13 min read · 25 July 2026

Edge agents vs cloud round-trips in 2026

A practical guide to building on-device agents with ONNX Runtime, Redis caching, confidence-based cloud fallback, and honest ways to measure latency and memory.

11 min read · 23 July 2026

AI code in prod? Postmortems still work

AI-generated code hides its assumptions. Capture the prompt, model snapshot and runtime context so incident reviews explain decisions, not just stack traces.

11 min read · 21 July 2026

Cache stampedes: the patterns that scale and the ones…

How cache stampedes happen, why lazy TTLs fail under load, and how to implement coordinated refresh with locks, stale fallbacks, and jitter.

16 min read · 21 July 2026

Stabilize multi-model agent routers: six production rules

Six rules for multi-model agent routers: bounded concurrency, idempotency keys, timeouts, observability, and how to measure each one yourself.

15 min read · 15 July 2026

Observability for LLM Features: Metrics That Drive Decisions

Log one structured event per LLM interaction instead of tracing every token, then alert only on user-facing outcomes that justify keeping a feature.

14 min read · 8 July 2026

7 ways to measure prompt platform ROI in 2026

How to attribute token cost, latency and developer time to prompt and agent platforms, with instrumentation recipes, failure modes and a decision checklist.

14 min read · 8 July 2026

AI feature drift: why your model died at midnight

Diagnose nightly AI model drift and FeatureStoreKeyNotFound errors: tokenizer drift, memory fragmentation, and cold-start timeouts, with fixes.

14 min read · 7 July 2026

Build agent workflows that survive restarts

How to build agent task pipelines that resume after crashes, schema drift and model changes, using Redis streams, idempotent steps and replay.

12 min read · 6 July 2026

AI agents: circuit breakers are not optional

AI agents fail by hanging and returning plausible garbage, not by crashing. Here is how to add a circuit breaker that catches semantic failures.

13 min read · 3 July 2026

Serve 4G-as-baseline apps in 2026

Design APIs for 300 ms RTT, packet loss and data caps: payload budgets, stale-while-revalidate caching, adaptive fetch and honest measurement.

14 min read · 3 July 2026

Meter dev-tool pricing in 2026

Build usage-metered pricing for a dev tool: Stripe metered billing, Redis counters, idempotent usage events, and the edge cases that break first.

11 min read · 2 July 2026

AI memory systems: context that survives sessions

Why AI agents silently lose memory across restarts, how to scope memory to a session, and how to test persistence before production.

12 min read · 2 July 2026

Postgres 17 swallowed Redis, Kafka, Timescale

How to evaluate consolidating Redis, Kafka and a time-series database into Postgres extensions, with honest limits, failure modes and a checklist.

14 min read · 2 July 2026

AI agents killed dev tool sales cycles

How agent-driven evaluation changes integration design, onboarding, and pricing for developer tools, with concrete patterns and a 30-minute test.

10 min read · 2 July 2026

Double the price, double the revenue

How to design four-tier pricing for a developer tool: seat limits, usage counters, feature gates, plan enforcement, and how to measure whether it converts.

13 min read · 30 June 2026

When flags become experiments

How to run feature flags and A/B tests on a $5 VPS with no data warehouse, using offline-tolerant self-hosted tooling and SMS replies as conversions.

15 min read · 28 June 2026

AI fixes legacy code nobody owns

How to combine static analysis, runtime traces, and LLM contextualization to make unowned legacy systems legible, with code and failure modes.

19 min read · 27 June 2026

Starlink 4G fallback: serve pages under 800ms

How to build a streaming HTML shell, small client bundle and edge cache that keeps TTFB under 800ms on 4G, satellite and low-end Android devices.

13 min read · 26 June 2026

Postgres 17 buried Redis, S3, cron

How to evaluate Postgres 17 as a cache, scheduler and blob store, with measurement steps, failure modes and a decision checklist.

11 min read · 26 June 2026

Webhooks done right: retries that don’t explode in 2026

A practical guide to webhook delivery: idempotency, retry budgets, silent rate limits, poison-message triage, and what to instrument before you scale.

10 min read · 25 June 2026

AI observability isn’t monitoring — here’s why

Traditional monitoring proves a service is up; AI observability proves its outputs are still correct. Layers, code, drift math, and failure modes.

14 min read · 25 June 2026

Store data once, serve everywhere: cheaper

How to serve reads from regional caches instead of replicating your database everywhere, with worked cost math, invalidation code, and failure modes.

12 min read · 25 June 2026

Alerts 2026: AI turns false alarms to silence

Build a webhook service that counts alert firings per fingerprint and demotes noisy alerts, plus how to measure whether it works.

15 min read · 24 June 2026

API abuse patterns rising in 2026

A layered architecture for stopping credential stuffing and scraping: client integrity tokens, cohort-based rate limiting, and behavioral scoring at the CDN edge.

12 min read · 24 June 2026

Unlock Python 3.13's free-threaded GIL for web apps

Free-threaded Python removes the GIL, but C extensions, shared state and pools break. A practical checklist for migrating a web service safely.

14 min read · 22 June 2026

JSON mode’s silent failures exposed

JSON mode enforces grammar, not your contract. Here is how to build a schema-validated envelope pipeline with deterministic repair and quarantine.

11 min read · 21 June 2026

AI stole system design

AI can generate a polished system design in seconds. Here is how to redesign interviews around live debugging so you test real understanding.

11 min read · 21 June 2026

Vibe code: works great, fails forever

Ten failure modes that make vibe-coded MVPs unmaintainable, with code fixes, measurement recipes, and a hardening checklist for each.

13 min read · 20 June 2026

Defending APIs Against Amplification, Stuffing and Smuggling

How cache-stampede amplification, credential stuffing and HTTP/2 request smuggling work, plus edge admission, idempotency keys and circuit breakers that blunt them.

13 min read · 20 June 2026

Tiered API abuse defense: match cost to attacker economics

Five API abuse patterns that inflate cloud bills, why edge-only blocking fails, and how to build tiered defenses with measurable cost-per-request targets.

11 min read · 20 June 2026

Tool calling: stateless beats stateful under load

How request-scoped and pooled tool calls behave under load, what to instrument, and a decision checklist for choosing between them.

11 min read · 19 June 2026

Portfolio that hires: show constraints, not code

A portfolio that proves engineering judgement: latency budgets, load tests, failure-mode notes and honest trade-offs recruiters can verify.

14 min read · 16 June 2026

Pricing SaaS tools by real cost, not seat count

A practical method for pricing usage-based SaaS: instrument cost per request, model support burden, guard free tiers, and replay traffic before publishing.

13 min read · 15 June 2026

Tool calls under load: async batch vs fire-and-forget

Compare async batch and fire-and-forget tool-calling patterns: when each fits, how to instrument latency and queue depth, and how to pick a batch size.

16 min read · 13 June 2026

AI-native apps: forget the old stack

LLM-backed services are token-bound, stateful and failure-prone. Learn the failure modes, how to measure them, and patterns that contain them.

10 min read · 12 June 2026

Personal AI assistants: avoid vendor lock-in traps

How to structure a personal AI assistant as replaceable services: contracts, self-hosted embeddings, retries, failure modes, and a checklist to start.

15 min read · 11 June 2026

AI agents eat your budget 3 ways

Token inflation, retry storms and timeout math quietly inflate AI agent bills. Learn how to instrument, cap and verify each cost vector.

12 min read · 11 June 2026