Uber H3 Spatial Clustering & Redis Semantic Caching

Answer-First: Redis semantic caching for routing queries utilizes geo-hash indexing and embedding similarity vectors to serve frequent route lookups with sub-5ms latency. Pillar Architecture Guide: This article is part of the GitOps at Scale: Kubernetes & ArgoCD for Microservices series. Please refer to the original article for a comprehensive overview of the architecture. Prerequisite: Before reading this part, review Part 5: Route Visualization UI. Part 6: Location Clustering with Uber H3 & Redis Semantic Caching Executive Summary & Quick Answer: Semantic caching transforms continuous floating-point GPS coordinates into discrete Uber H3 hexagonal keys (Resolution 8/9), increasing cache hit rates from 0% to over 80%. Combining H3 spatial keys with Redis MGET pipelines and XFetch early recomputation prevents cache stampedes and lowers matrix latency to <2ms. ...

June 15, 2026 · 10 min · Lê Tuấn Anh

Go Cache Defenses: Stampede, Avalanche & Singleflight

Multi-tier distributed caching using Redis clusters and in-memory LRU buffers prevents database thundering herd and reduces read latency to sub-millisecond ranges. Pillar Architecture Guide: This article is part of the High-throughput Go Framework Benchmarks: Gin, Fiber, Kratos series. Please refer to the original article for a comprehensive overview of the architecture. Prerequisite: Before reading this chapter, review Chapter 1: How Systems Handle Millions of Requests/s. What You’ll Learn That AI Won’t Tell You Bloom Filter Math: How to calculate bit array sizes ($m$) and hash function counts ($k$) for <1% false positive rates. XFetch Beta Tuning: Adjusting the scaling factor ($\beta$) to force probabilistic background recomputation before TTL expiration. Singleflight Timeout Leaks: Guarding singleflight calls with Go context deadlines to prevent goroutine hangs. Caching is the ultimate shield for databases in distributed systems. However, poorly implemented caches can become the exact reason your system crashes. In this chapter, we dissect three classic caching phenomenons and how to defend against them using Golang. ...

June 9, 2026 · 9 min · Lê Tuấn Anh

Shopee Flash Sale Engine: Redis Lua & Overselling

Answer-First: Shopee prevents overselling during high-concurrency flash sales by combining local memory caching, Redis inventory sharding, and atomic Lua script decrements. This multi-tier architecture isolates hot keys in Redis memory shards and evaluates stock availability in sub-milliseconds without acquiring relational database locks. Chapter 2: Flash Sale Engine - The Mystery Behind Redis and Hot Keys ← Series hub | ← Prev | Next → Prerequisite: Read the previous article: Chapter 1: Microservices Foundation - The Power of Go, gRPC, and API Gateway. ...

May 5, 2026 · 8 min · Lê Tuấn Anh