Skip to content

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Latest articles

7 min read

Boosting Performance 25× and Cutting Costs 80%: Our Switch from Redis to DragonflyDB

Facing high memory overhead, operational complexity, and scaling limits of a large Redis cluster, we migrated to DragonflyDB using a three‑stage shadow, dual‑write, and cut‑over process, achieving up to 25‑fold throughput increase, 80% cost reduction, and simpler maintenance while preserving compatibility with existing Redis clients.

15 min read

240 Go Interview Questions with Answers – Master Them in 3 Passes to Land the Job

This article compiles a comprehensive set of 240 Go interview questions—including fundamentals, concurrency, runtime, and related topics such as containers, Redis, and MySQL—each paired with answers, offering candidates a structured study guide to repeatedly practice and improve their chances of securing a Go development position.

19 min read

How to Build a Million‑User Ticket‑Snatching System with Nginx, Redis, and Go

This article explains how to design a high‑concurrency ticket‑snatching service that can handle millions of requests by combining multi‑layer load balancing, weighted Nginx round‑robin, in‑memory stock with Redis‑backed global inventory, and Go’s native concurrency, complete with code samples and performance results.

17 min read

Prevent Duplicate Submissions and Rate‑Limit APIs with the Guardian Spring Boot Starter

This article introduces Guardian, a lightweight Spring Boot starter that provides anti‑duplicate‑submission protection and request rate limiting, explains how to integrate it via Maven, configure it with annotations or YAML, and details its internal workflow, storage options, concurrency handling, and monitoring capabilities.

13 min read

Mastering MySQL Performance: Connection Pool Tuning, Built‑in Cache, and Application‑Level Caching

This guide walks through three defensive layers for MySQL performance—optimizing the connection pool, configuring the query cache and memory tables, and designing multi‑level application caches (including Cache‑Aside, Write‑Through, and Redis integration) with concrete code examples and best‑practice recommendations.

17 min read

Build Your Own Spring Boot API Guard: Anti‑Duplicate Submissions and Rate Limiting

The article introduces Guardian, a lightweight Spring Boot starter that provides independent anti‑duplicate‑submission and rate‑limiting modules, explains why a custom solution is preferable to raw Redis locks, and walks through annotation and YAML configurations, key generation, response handling, storage options, concurrency safety, and observability.

21 min read

Building a Million‑User Ticket‑Spiking System with Nginx Load Balancing, Redis, and Go

This article explores how to design a high‑concurrency ticket‑spike service inspired by China’s 12306 platform, covering multi‑layer load balancing, local stock pre‑allocation, Redis‑based global inventory control, Go implementation details, and performance testing that demonstrates handling millions of simultaneous requests.

26 min read

Mastering Redis Memory: From Basics to Advanced Troubleshooting

This comprehensive guide walks you through the real costs of Redis memory problems, explains the three‑layer memory architecture and five major consumers, provides a toolbox of INFO and MEMORY commands plus monitoring scripts, and offers step‑by‑step solutions for seven common issues, best‑practice optimizations, real‑world case studies, a daily checklist, and advanced techniques such as Lua scripts and smart cache warm‑up.

23 min read

How to Build a Hybrid Vector‑+‑Text Search with Redis 8 (No GPU Required)

This article walks through the complete setup of a hybrid retrieval pipeline on two CPU‑only Linux servers using Redis 8, Qwen‑3‑Embedding vectors, and RediSearch to combine BM25 keyword scores with cosine‑based vector similarity, showing environment details, index creation, data ingestion, the hybrid_search function implementation, result normalization, and a common pitfall of forgetting to set the query language to Chinese.

34 min read

JD Interview: Redis Lock Expiration Mid‑Task – How Redisson’s Watchdog Auto‑Renews

The article explains what occurs when a Redis distributed lock expires before a business operation completes, and details how Redisson’s watch‑dog mechanism automatically renews the lock, covering the underlying principles, configuration, code examples, and comparisons with alternative renewal approaches.

14 min read

Evolution of a Recommendation System Architecture: From V1.0 to V3.0

The article traces the evolution of an e‑commerce recommendation platform through three architectural versions, detailing the scalability, modularity, and configurability challenges of V1.0, the pipeline‑based improvements of V2.0, and the dynamic configuration service, AB testing, and distributed recall and prediction services introduced in V3.0.

11 min read

Master Go Rate Limiting: Sliding Window, Token Bucket, and Redis Techniques

This article presents four practical Go rate‑limiting implementations—a sliding‑window algorithm, a token‑bucket approach, the built‑in golang.org/x/time/rate package, and a Redis‑backed distributed limiter—complete with code samples, usage guidance, and recommendations for different deployment scenarios.

30 min read

Why Does Redis Crash? Understanding Eviction Strategies, Their Internals, and Monitoring Metrics

The article explains how Redis eviction policies work, why configuring maxmemory and a proper policy is essential to avoid OOM crashes, details each of the eight policies, shows practical configuration and monitoring commands, and dives into the source‑code implementation of LRU/LFU eviction.

8 min read

Why Ticket Sales Fail: A Deep Dive into Concurrency, Locks, and Building a Reliable Ticket‑Booking System

When half a million users simultaneously try to buy 5,000 concert tickets, naive ordering logic leads to race conditions and double bookings, so the article walks through the root causes, compares pessimistic, optimistic, and Redis distributed locks, and presents an industrial‑grade microservice design with a three‑stage state machine to ensure strong consistency and high availability.

8 min read

How a Virtual AI Team Built with Clawdbot Can Run Real Business Operations

The article details a founder's implementation of a ten‑agent AI team using the open‑source Clawdbot (now OpenClaw) framework, describing its architecture, cost‑saving heartbeat mechanism, Mission Control collaboration platform, and a concrete workflow that lets the agents autonomously produce competitive analyses, marketing content, and code tasks for a company.

8 min read

Scale a Monolithic Article Interaction Service with Kubernetes Microservices

This article walks through converting a single‑service article interaction module—handling likes, favorites, and reads—into independent microservices deployed on Kubernetes, detailing architecture goals, service separation, Redis‑based high‑concurrency handling, Kafka async persistence, deployment configurations, auto‑scaling, and real‑world performance results.

7 min read

Redis Creator Says Stop Fighting AI: Programming Logic Is Being Reshaped

In a candid blog post, Redis founder Salvatore Sanfilippo admits he’s “surrendered” to AI, showing how Claude Code helped him refactor a library, fix transient bugs, build a C‑based BERT inference engine, and rewrite Redis Streams in minutes, arguing that manual coding is no longer the wise choice for most projects.

12 min read

How to Prevent Redis Split‑Brain Disasters with min‑replicas‑to‑write

This article explains the Redis split‑brain problem that can occur in master‑replica clusters, outlines the interview points interviewers look for, and provides a detailed solution using the min‑replicas‑to‑write (or min‑slaves‑to‑write) configuration to sacrifice write availability for data consistency, along with best‑practice recommendations and common pitfalls.

7 min read

Getting Started with Valkey Glide PHP: A High‑Performance Redis‑Compatible Client

This guide introduces Valkey Glide PHP, the official high‑performance PHP client for the Valkey in‑memory datastore, explains its core Rust‑based architecture, shows three installation methods, highlights key features such as cluster‑aware commands and TLS, and provides ready‑to‑run code examples for single‑node and clustered environments.

7 min read

Why Redis High Availability Fails: Split‑Brain and Replication Storm Explained

The article examines the two most dangerous production failures in Redis high‑availability—split‑brain and replication storm—explaining their causes, real‑world impact, and practical engineering safeguards such as write‑protection parameters, network isolation, backlog sizing, and cascading replication.

17 min read

How to Keep Database and Redis Cache Consistent Under High Concurrency

This article examines the common data‑consistency challenges when writing to both a database and a Redis cache, evaluates four write‑order strategies, and presents the most reliable approach—writing to the database first then deleting the cache—along with retry mechanisms using scheduled jobs, message queues, and binlog listeners.

17 min read

How to Keep Cache and Database Consistent: 4 Common Strategies and Their Pitfalls

This article examines the double‑write consistency problem between databases and caches like Redis, explains why naïve cache‑first or DB‑first updates can cause stale or phantom data under high concurrency, and evaluates four practical solutions with detailed trade‑offs and recommended retry mechanisms.

10 min read

10 Core Architecture Patterns for Scalable LLM Skills and Context Engineering

The article presents a ten‑step architecture for implementing scalable LLM Skills, covering a meta‑tool pattern to avoid tool explosion, progressive three‑level loading to save tokens, script execution outside the LLM context, Redis‑based storage with pub/sub updates, version locking, dynamic addition, batch loading, and file‑system strategies.

9 min read

How to Build a High‑Concurrency Flash‑Sale System with Spring Boot, Redis, and Lua

The article analyzes why flash‑sale systems often crash under extreme traffic and presents a step‑by‑step solution using Spring Boot, Redis, and Lua that prevents overselling, pre‑warms stock, applies token‑bucket rate limiting, executes atomic stock deductions, and decouples order creation asynchronously while adding monitoring and safety measures.

9 min read

How to Ensure Single-Node Execution of Spring Boot @Scheduled Tasks in Distributed Environments

This guide explains why @Scheduled jobs run on every Spring Boot instance in a cluster, and presents three practical solutions—Spring Integration's Redis lock, Redisson, and ShedLock—complete with Maven dependencies, configuration snippets, code examples, and runtime screenshots to guarantee that only one node executes the scheduled task at a time.

5 min read

Mastering Flash‑Sale TPS: Scalable Backend Architecture for E‑commerce

This article explains how e‑commerce flash‑sale systems handle extreme concurrency by defining TPS requirements for different scales, applying a layered filtering architecture, and using techniques like CDN caching, rate limiting, Redis pre‑deduction, and minimal database writes to ensure stability.

11 min read

Claude Code Generates Unexpected Bugs: 4 Real-World Spring Pitfalls and Fixes

During a Spring‑based interview platform project, the author discovered four typical bugs introduced by Claude Code—transactional self‑invocation loss, AI‑generated NullPointerExceptions, async task failures after entity deletion, and Redis Stream message buildup—and explains the root causes and concrete remediation steps.

26 min read

Why Sentinel Fails for Per‑User Hourly Limits and How Redis + Lua Solves It

The article compares four user‑level rate‑limiting approaches—Sentinel hotspot parameters, Sentinel ordinary flow control with cluster mode, Redis ZSet + Lua scripts, and Guava RateLimiter—explaining why Sentinel is unsuitable for long‑window low‑frequency limits and why Redis + Lua is the optimal solution for high‑traffic e‑commerce scenarios.

24 min read

What Tencent Backend Engineers Earn and How to Nail Their Interview

This article shares a collected list of 2023 Tencent backend developer compensation packages—showing total first‑year offers starting above 40 W RMB—followed by detailed explanations of interview questions covering Redis caching, MySQL transactions, hot‑key detection, SQL injection, HTTP/HTTPS differences, API timeout troubleshooting, and microservice migration strategies.

11 min read

Scalable GPS Data Backend: SpringBoot, Kafka, MongoDB & Redis Design

This guide outlines a complete backend architecture for high‑volume GPS data, detailing the overall system flow, technology stack choices, Maven dependencies, data models, Kafka producer/consumer configurations, SpringBoot controllers, asynchronous processing, Redis caching, health checks, Docker deployment, and performance tuning recommendations to ensure stability and scalability.

10 min read

Achieve 10× Faster APIs with Spring Boot 3’s Three‑Level Cache Pyramid

The article demonstrates how to combine Spring Boot 3, Caffeine local cache, and Redis into a three‑level cache pyramid, reducing API response time from 28 ms to 2 ms, cutting CPU usage by 35 %, and providing detailed configuration, code examples, performance benchmarks, and mitigation strategies for common high‑concurrency pitfalls.

33 min read

How We Built a High‑Performance, Low‑Cost Content Moderation System with Trie + Aho‑Corasick

Faced with minutes‑long posting delays and exploding review costs in a fast‑growing social app, the team introduced 24‑hour shift staffing, a local blacklist stored in MySQL, an in‑memory Trie + Aho‑Corasick matcher, Redis‑driven hot updates and a machine‑audit fallback with a feedback loop, dramatically cutting latency, cost and false‑positives.

20 min read

Mastering API Rate Limiting with Spring Interceptor and Redis

This article walks through building a Spring MVC interceptor that leverages Redis to enforce per‑IP request limits, explains configurable parameters, shows how to apply protection selectively via mapping rules or custom annotations, and discusses practical pitfalls such as sliding‑window logic, path‑parameter handling, and real‑IP detection.

18 min read

Redis on Linux: From Basics to Production-Ready Scripts

This guide covers Redis core data types (String, List, Hash, Set, Sorted Set) with practical Linux command examples, demonstrates building a message queue with List and storing user profiles with Hash, and provides production-ready shell scripts for backup, monitoring, and automated cleanup of idle keys, plus common pitfalls to avoid.

4 min read

Choosing the Right Distributed ID Generation Strategy: Auto‑Increment, UUID, Snowflake, and Redis

This guide compares four common distributed ID generation techniques—database auto‑increment, UUID, Twitter’s Snowflake, and Redis INCR—detailing their advantages, drawbacks, and ideal use‑cases, helping architects select the most suitable method for their system’s scalability and performance requirements.

12 min read

Why High‑Concurrency Spring Boot APIs Fail and 6 Must‑Know Caching Strategies for 2026

The article explains that overwhelming request rates exceed database capacity, causing exponential latency, and presents six proven cache‑design techniques—including in‑process, Redis, multi‑level, cache‑aside, write‑through/write‑behind, and edge caching—to keep Spring Boot APIs stable, fast, and cost‑effective under high load.

15 min read

Mastering Redis Distributed Locks: From SETNX to RedLock and WatchDog

This article walks through the evolution of Redis distributed locks—from basic SETNX mutual exclusion to atomic SET with expiration, Lua‑based safe unlocking, Redisson's WatchDog auto‑renewal, and the RedLock algorithm—highlighting pitfalls, best‑practice implementations, and interview‑style Q&A for robust production use.

6 min read

Mastering Redis: Choosing the Right Data Structure for High‑Performance Systems

Redis offers five core data types—String, Hash, List, Set, and ZSet—each acting as a high‑performance concurrent data structure that determines system throughput, latency, and stability; this guide explains their characteristics, optimal use‑cases, anti‑patterns, and practical code examples for robust architecture design.

11 min read

Building a High‑Performance Go Database Access Layer for Microservices

This article dissects a production‑grade Go database access framework for microservices, covering unified interface abstraction, factory pattern for multi‑DB support, PostgreSQL array handling, read‑write splitting with load balancing, Redis cache protection, monitoring, and deployment considerations, with full code examples and open‑source links.

9 min read

Production-Ready Idempotency for RocketMQ Duplicate Consumption (Full Code)

To reliably handle RocketMQ's at-least-once delivery semantics, this guide explains why duplicate consumption is inevitable, outlines three defensive layers—Redis‑based idempotency, database unique constraints, and state‑machine checks—provides production‑grade Java code, and details ACK/retry strategies and monitoring practices for robust systems.

15 min read

Master Redis Distributed Locks: Prevent Race Conditions, Zombie Locks, and Expiration Issues

This guide explains how Redis implements distributed locks, outlines common pitfalls such as lock contention, zombie locks, and mismatched expiration times, and provides step‑by‑step solutions—including single‑node SET commands, Redlock high‑availability algorithm, Lua‑based safe release, and best‑practice recommendations for real‑world deployments.

11 min read

How to Keep a Go System Stable: Middleware, Redis, MQ, and Beyond

This article breaks down the core concerns interviewers have for senior Go engineers—system stability, middleware pitfalls, Redis risk isolation, message‑queue buffering, distributed consistency, configuration management, ID design, and avalanche prevention—offering concrete insights and practical interview answers.

21 min read

What’s Wrong with Delayed Double Delete? How Top Tech Companies Elegantly Avoid It

The article explains the delayed double‑delete cache‑invalidation pattern, its four major drawbacks in high‑concurrency environments, and presents four production‑grade alternatives—event‑driven binlog updates, distributed‑lock with versioning, write‑through proxy layers, and logical‑delete with async cleanup—used by leading Chinese internet firms to achieve reliable data consistency.