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

12 min read

Distributed Multi-Rule Rate Limiting & Duplicate Prevention with Redis ZSet & Lua

This article demonstrates how to implement distributed multi-rule rate limiting and duplicate submission prevention using Redis sorted sets and atomic Lua scripts, covering annotation design, key generation, concurrency handling, and two Lua implementation strategies with retry logic for timestamp collisions.

23 min read

Java Collaborative Editing: Block Versioning, CRDT, and Handling Concurrent Document Edits

This article details how to build real-time collaborative editing in Java using Spring Boot, covering block-level versioning to reduce conflicts, conditional database updates for concurrency control, WebSocket broadcast after transaction commit, reconnection with operation replay, CRDT integration via Yjs for character-level editing, multi-instance deployment with Redis and message brokers, permission validation, and history version recovery without rollback.

14 min read

Why Redis Default Config in Production Is a Security Disaster (And How to Fix It)

This guide explains why Redis default configuration exposes servers to unauthorized access attacks, detailing six critical settings to change—authentication, network binding, protected mode, port exposure, dangerous commands, and non-root execution—plus memory limits, eviction policies, slow logging, big key detection, backup procedures, and a pre-launch checklist for production-ready Redis deployments.

9 min read

Redis Large Key & Multi-Key Splitting: 4 Practical Patterns for Big Values, Massive Collections, and Bloom Filters

The article details four Redis splitting strategies: sharding oversized single-key values via multiGet or hash fields, bucket-sharding large hash/set/zset/list collections using client-side hash modulo, consolidating hundreds of millions of string keys into hash structures to cut memory overhead, and partitioning large bitmaps or Bloom filters into independent shards while preserving false-positive rates.

12 min read

Redis High Availability: Three Tiers from Replication to Cluster — Choose the Right Level

This article explains Redis high availability as a three-tier progression — master-slave replication for redundancy, Sentinel for automatic failover, and Cluster for sharding — detailing configuration, split-brain prevention, multi-key limitations, and a decision framework to avoid over-engineering.

12 min read

Redis Persistence: RDB, AOF, Hybrid & the Pure Cache Dilemma

This article explains Redis persistence mechanisms (RDB snapshots, AOF logging, hybrid persistence), their trade-offs (fork latency, memory overhead, data loss windows), and provides a decision framework: disable persistence for pure caches backed by a database, enable RDB+AOF everysec for caches with locks/counters, and never rely on Redis as the sole source of truth.

14 min read

Spring Boot Redis Caching: Beyond @Cacheable — Serialization, Keys, and Pitfalls

This article explains how to properly implement Redis caching in Spring Boot using @Cacheable, @CachePut, and @CacheEvict, covering JSON serialization, key design, annotation failure scenarios, memory eviction policies, cache penetration/breakdown/avalanche prevention, consistency patterns, and template selection.

12 min read

Prevent Spring Boot Cache Penetration with a Single @BloomCheck Annotation

This article introduces the bloomfilter-spring-boot-starter library that provides declarative @BloomCheck and @BloomAdd annotations to prevent cache penetration in Spring Boot 3.5+, supporting both in-memory and Redis backends with fail-open safety, keyed SipHash, Micrometer metrics, and scheduled filter rebuilds.

5 min read

Why MongoDB Struggles in China: Stuck Between Caching, OLTP, and OLAP

The article argues MongoDB's positioning is awkward: early versions lacked persistence and competed with Redis, but Redis now dominates caching with alternatives like TiKV and Hazelcast; MongoDB's JSON advantage is eroded by PostgreSQL and Redis ReJSON; for OLTP it cannot match MySQL-compatible distributed databases like TiDB; for OLAP it is outclassed by modern lakehouse engines such as ClickHouse and Doris.

12 min read

E-Commerce Inventory Deduction: From MySQL Row Locks to Redis Lua Scripts

This article analyzes three approaches to e-commerce inventory deduction—single-row MySQL, sharded MySQL, and Redis with Lua scripts—detailing why database row locks fail under high concurrency and providing a complete Redis-based implementation with distributed locking for cache initialization and atomic stock decrement.

14 min read

Distributed ID Generation: 8 Strategies from UUID to Snowflake

This article compares eight distributed ID generation approaches—UUID, database auto-increment, segment mode, Redis, Snowflake, Baidu UidGenerator, Meituan Leaf, and Didi TinyID—detailing their mechanisms, pros, cons, and real-world implementations to help choose the right solution for scalable systems.

12 min read

Deduplicating 4 Billion QQ Numbers in 1GB Memory: Bitmap and Bloom Filter Deep Dive

This article explains how to deduplicate 4 billion unsigned integers within a 1GB memory constraint using Bitmap and Bloom Filter data structures, detailing memory calculations, implementation principles, false-positive trade-offs, and practical Java code examples with Guava, Apache Commons, and Redis.

19 min read

From Frontend to Full-Stack: Delivering a Live-Stream Mini-Game with AI

A frontend developer at Huajiao used AI to build a live-stream mini-game 'Guagua Le', covering interaction prototyping, UI design, backend development with PHP/Redis, API design, transaction handling, caching, verification with real data and concurrency tests, and phased deployment, demonstrating how AI lowers the barrier for frontend engineers to expand into full-stack delivery.

52 min read

Redis Production Survival: Big Keys, Hot Keys & the Monitoring That Prevents Outages

This article dissects three real Redis incidents — an 800MB key deletion that triggered cascading failovers, an 180K QPS hot key that saturated one shard while five idled, and an unmonitored disk that killed AOF rewrites — then delivers a complete playbook for detecting, governing, and observing big keys and hot keys using layered tooling, async deletion, local caching, replica sharding, and a four-tier monitoring stack.

46 min read

Redis Distributed Locks: SET NX EX Pitfalls, Watchdog Renewal, and the Redlock Debate

This article analyzes three production incidents to explain Redis distributed lock pitfalls, detailing correct implementation with atomic SET NX EX, unique values, Lua unlocking, watchdog renewal for TTL dilemmas, fencing tokens for correctness guarantees, Redlock's five-step majority quorum, the Martin Kleppmann vs antirez safety debate, and a decision tree for choosing between single-instance Redis, Redlock, ZooKeeper, or etcd.

50 min read

Redis Cache Consistency: Cache-Aside, Delayed Double Delete, Binlog Fallback & Versioning

This article analyzes Redis cache consistency through three real incidents, compares four read-write patterns, explains why update-DB-then-delete-cache (Cache-Aside) is optimal, details delayed double delete, binlog subscription fallback, versioning, monitoring, and a decision tree for choosing consistency levels.

48 min read

Redis Cache Penetration, Breakdown & Avalanche: Three Lines of Defense

This article dissects Redis cache penetration, breakdown, and avalanche as three forms of cache-miss storms, detailing layered defenses — Bloom filters for penetration, mutex locks and logical expiration for breakdown, TTL jittering plus multi-level caching and rate limiting for avalanche — with implementation code, capacity formulas, and production checklists.

44 min read

Redis Expiration & Eviction: 8 Strategies, Trade-offs & Source Code Analysis

This article analyzes Redis expiration deletion and memory eviction mechanisms, detailing eight eviction policies, their trade-offs, three production incidents, source code walkthroughs of lazy/active expiration and LFU/LRU approximations, and practical configuration guidelines for avoiding common pitfalls.

44 min read

Redis Replication & Sentinel: Async Sync, Backlog Mechanics & Failover Internals

This article dissects Redis master-slave replication and Sentinel failover through three real incidents, explaining the replid/offset/backlog trio for incremental sync, async replication trade-offs, Sentinel's quorum/majority election, brain-split risks, and production configuration formulas for backlog sizing and replication storm mitigation.

33 min read

Redis Object Encodings Deep Dive: SDS, Listpack, Skiplist Memory-Performance Tradeoffs

This article analyzes Redis's internal object encodings (SDS, listpack, skiplist, hashtable, intset, quicklist), their automatic conversion thresholds, memory overhead calculations, and practical pitfalls like silent encoding upgrades that quadruple memory usage, providing a framework for choosing data structures and diagnosing production issues.

51 min read

Why Redis Is So Fast: Four Core Pillars, Real Incidents, and Source Code Insights

This article explains why Redis is fast through four core factors—memory storage, single-threaded command execution, I/O multiplexing, and optimized data structures—illustrated with three real production incidents, source code walkthroughs of key components like SDS and incremental rehashing, and practical guidelines for avoiding common pitfalls such as big keys, hot keys, and misconfigured eviction policies.

76 min read

Java Campus Recruitment Crash Course: From Core Concepts to Deployable Projects in 30, 60, or 90 Days

A structured Java backend interview preparation guide covering core Java, MySQL, Spring ecosystem, Redis, message queues, microservices basics, deployment, and project practice with flexible 30-day, 8-week, and 12-week schedules for campus recruitment candidates.

37 min read

Building a Production-Ready Online Exam System with Spring Boot 3: Paper Assembly, Anti-Cheating & Auto-Grading

This article details a production-grade Spring Boot 3 online exam system covering domain modeling, constraint-based paper assembly algorithms, anti-cheating measures with behavior logging and risk scoring, auto-grading strategies for objective and subjective questions, high-concurrency handling for exam start/submit, and score analysis with streaming exports.

8 min read

Implementing Spring Boot API Rate Limiting with Redis and Custom Annotations

This article demonstrates how to implement API rate limiting in Spring Boot using Redis for request counting and a custom @RequestLimit annotation with an interceptor to enforce limits per user session, including complete code examples for the annotation, interceptor, configuration, and controller usage.

95 min read

Redis Memory Growth, Eviction Policies & Large Key Governance: A Complete Operational Guide

This comprehensive guide analyzes Redis memory growth causes, details all eight eviction policies with their trade-offs, and provides battle-tested techniques for discovering and safely removing large keys without blocking the instance, backed by a real-world case study of a 1.3GB Hash with 1.2M fields.

23 min read

Spring Boot Distributed Locks: From Redisson Watchdog to RedLock Controversy

This article analyzes distributed locking in Spring Boot using Redis and Redisson, covering atomic locking with SET NX EX, watchdog lease renewal, reentrant Hash-based design, pub/sub wait notification, the RedLock algorithm debate including Martin Kleppmann's GC pause and clock jump critiques, and production pitfalls with annotation-based AOP encapsulation.

11 min read

Java SMS One-Click Login: Complete Production-Ready Implementation with Rate Limiting & Anti-Brute Force

This article provides a complete Java implementation of SMS one-click login using Spring Boot 3, Redis, and JWT, covering business flow, configuration, Redis key design, core service code with rate limiting, blacklist, daily limits, one-time verification codes, login verification with JWT issuance, controller endpoints, production security optimizations including Lua atomic scripts, graphical captcha, channel fallback, risk control, and compliance, plus extension directions like carrier authentication and anomaly detection.

39 min read

Building a Real-Time Risk Control Decision Engine with Spring Boot: Rule Orchestration, List Services, Feature Computation & Decision Traceability

This article details a production-grade risk control engine built with Spring Boot 3 and Java 17, covering five-layer architecture, DSL-based rule modeling with decision tables, Bloom-filter-accelerated list services, sliding-window real-time feature computation via Redis+Lua, timeout-aware orchestration with tiered degradation, and full decision traceability for audit and tuning.

9 min read

LangChain4j RAG Chunking Strategies: Recursive Splitting, Overlap Windows & Parent-Child Retrieval

This article details a three-tier semantic chunking approach for RAG systems using LangChain4j: recursive punctuation-based splitting, tokenizer-aware overlapping windows, and parent-child document mapping with Redis and Qdrant to balance retrieval precision and context completeness.

38 min read

Building an Enterprise Alert Center with Spring Boot: Convergence, Silencing, On-Call & Escalation

This article details a Spring Boot-based enterprise alert center architecture covering alert ingestion, standardization, four-layer convergence (deduplication, grouping, inhibition, silencing), routing, multi-channel notification, on-call scheduling, escalation policies, and closed-loop governance with SLO integration.

9 min read

4 Patterns for MySQL-Redis Cache Consistency: Trade-offs Explained

This article explains why cache inconsistency occurs between MySQL and Redis, then analyzes four update patterns—delete-then-update, update-then-invalidate, read/write-through, and write-behind—detailing their execution flows, consistency guarantees, and trade-offs to help choose the best fit for your scenario.

18 min read

Java Multi-Device Login: Session-Centric Architecture for Device Control & Concurrency

This article details a session-centric Java architecture for multi-device login, covering device session creation, JWT with session IDs, single-device logout, admin forced logout, per-device-type concurrency control using Redis atomic operations, login limits with LRU eviction, device ID generation, refresh token binding, and security considerations for immediate token revocation.

35 min read

Redis Production Governance: Big Keys, Hot Keys, Memory & Scaling

This article shares real-world Redis governance practices covering big key detection via SCAN sampling and RDB analysis, hot key detection using client-side sliding windows, memory fragmentation and eviction strategies, slow query and connection pool tuning, cluster scaling with redis-cli, and building an automated governance platform with scheduled inspections and alerting.

33 min read

Spring Boot Caching: From @Cacheable to Multi-Level Consistency Defense

This comprehensive guide explores Spring Boot's caching abstraction, detailing @Cacheable execution flow, source code internals, four consistency strategies (Cache Aside, delayed double-delete, binlog), multi-level Caffeine+Redis architecture, and eight production pitfalls with troubleshooting techniques.

45 min read

API Idempotency Deep Dive: 8 Patterns, 4-Layer Defense & Production Code

A comprehensive guide to API idempotency covering concept clarification, six sources of duplicate requests, a golden formula (unique key + deduplication storage + atomic operation), four-layer defense architecture, eight implementation patterns with code examples, common pitfalls with solutions, and interview preparation questions.

10 min read

Java SMS One-Click Login: Complete Implementation with Rate Limiting & Anti-Brute Force

This article provides a complete Java implementation of SMS one-click login using Spring Boot 3, Redis, and JWT, covering business flow, configuration, Redis key design, code for verification code generation, rate limiting, blacklist, and login validation, plus production security optimizations like Lua scripts, CAPTCHA, channel fallback, and compliance.

45 min read

Building a WebRTC Signaling Service with Spring Boot: Room Management, SDP Exchange, Recording Callbacks & Horizontal Scaling

This article details the architecture and implementation of a WebRTC signaling service using Spring Boot 3.2 and WebFlux, covering protocol design, room state management, media server integration, recording callbacks, horizontal scaling strategies, and fault tolerance for real-time audio/video applications.

6 min read

How to Implement Redis Cache Warming in Spring Boot

This article demonstrates how to implement Redis cache warming in Spring Boot using an abstract cache class, ApplicationContextAware utility, and CommandLineRunner to preload hot data at startup, with a concrete NewsCache example showing RedisTemplate integration and automatic cache reload on expiration.

17 min read

Designing a Scalable Multi-Account Login System: From Phone Auth to Carrier One-Click Login

This article details the evolution of a unified login system covering phone-based registration, third-party OAuth integration, a normalized database schema separating user profiles from authentication methods, and carrier-based one-click login that reduces authentication time from 20 seconds to 2 seconds.

6 min read

Implementing Redis Cache Preheating in Spring Boot: A Practical Guide

This article explains cache preheating concepts and demonstrates a complete Spring Boot implementation using an abstract cache class, ApplicationContext utility, CommandLineRunner for startup loading, and a concrete NewsCache example with RedisTemplate to load hot data at startup, reducing cache penetration and database load.

12 min read

GC Pauses Break Redis Locks: How Fencing Tokens Prevent Stale Overwrites

The article explains how Redis distributed locks with TTL leases fail to prevent stale writes when a garbage collection pause delays a lock holder past its lease expiry, allowing a new holder to write fresh data that the original holder then overwrites upon resuming; it demonstrates why fencing tokens — incrementing sequence numbers issued atomically with lock grants and checked atomically at the storage layer via conditional updates — are necessary to reject obsolete writes.

35 min read

China Merchants Bank Java Backend Interview: 20 Technical Questions & Answers

A developer shares their successful China Merchants Bank Java backend interview experience, detailing 20 technical questions covering HashMap, ConcurrentHashMap, synchronization, thread pools, Redis cache penetration, MySQL indexing, Spring Boot auto-configuration, Agent memory, RAG, multi-agent orchestration, and more, with answers and preparation tips.

21 min read

Elegant API Rate Limiting with Spring Interceptor, Redis & Custom Annotations

This article demonstrates building an elegant API rate limiter in Spring Boot using interceptors and Redis, evolving from a basic fixed-window implementation to a flexible annotation-driven design supporting per-endpoint limits, class-level defaults, and solutions for path parameters and sliding window logic.

21 min read

2026 System Architecture Designer Exam: Case Analysis Questions & Reference Answers

This article presents five case analysis questions from the May 2026 System Architecture Designer exam, covering time-series databases, MQTT QoS levels, concurrency control strategies, knowledge graph construction, and pipe-filter architecture for intrusion detection, with detailed reference answers for each scenario.

47 min read

Redis Memory Crisis: Big Key Detection & Expired Data Governance

This guide details a systematic approach to diagnose and resolve Redis high memory usage, covering memory composition analysis, big key detection via SCAN and MEMORY USAGE, root cause identification through TTL and access patterns, safe deletion using UNLINK and batched HDEL, and long-term governance via TTL jitter, index sharding, and monitoring alerts.

21 min read

Sa-Token Deep Dive: 10 Interview Questions on Auth, Multi-Account & SSO

This article explores 10 key Sa-Token interview questions covering core interfaces, one-line login internals, token styles, second-level authentication, multi-account architecture, distributed storage options, SSO comparisons, token passing strategies, permission annotation implementation, and production security hardening.

12 min read

Mastering High-Concurrency Caching: Penetration, Breakdown, Avalanche & Hot Keys

This article explains four classic high-concurrency caching problems—cache penetration, breakdown, avalanche, and hot keys—their root causes, differences, and practical solutions including empty-value caching, Bloom filters, mutex locks, logical expiration, TTL jitter, multi-level caching, and cache-database consistency patterns.

20 min read

Illustrated Redis: Architecture, Replication & Persistence Internals

This article provides a comprehensive visual guide to Redis architecture, covering single-instance deployment, high-availability setups with Sentinel, Redis Cluster sharding with hash slots, replication mechanics using replication IDs and offsets, and persistence models including RDB snapshots, AOF logging, and the fork/copy-on-write mechanism.

31 min read

12 Critical Issues in Custom Redis Distributed Session Design — Solved

This article details 12 critical technical challenges when building a custom Redis-based distributed session system, covering token security, dual-index design, atomic Lua writes, expiration strategies, multi-device limits, renewal optimization, ThreadLocal cleanup, HA degradation, framework comparison, anomaly detection, and Redis Cluster hash-tag routing.

17 min read

High-Concurrency Flash Sale Architecture: Layered Rate Limiting, Overselling Prevention & Cache Protection

This article details a production-grade five-layer architecture for high-concurrency flash sale systems, covering traffic shaping via message queues, multi-level rate limiting, three-tier overselling prevention using Redis atomic operations and database optimistic locking, and solutions for cache penetration, breakdown, and avalanche, plus nine common failure scenarios and a troubleshooting SOP.

31 min read

Building a Custom Redis Distributed Session: Token Design, Dual-Index Storage & Atomic Login

This article walks through designing a production-grade Redis-backed distributed session system, covering why single-node sessions fail under load balancing, secure token generation with SecureRandom, dual-index Redis storage using Hash and Set with Lua atomic writes, sliding vs absolute expiration, multi-device login limits, and complete login/logout/kick-out implementation with Redisson.

32 min read

Concurrent Write Correctness: Choosing Between Conditional Updates, Pessimistic/Optimistic Locks, and Distributed Locks

This article analyzes four concurrency control patterns — conditional updates, pessimistic locking, optimistic locking with version numbers, and distributed locks — using inventory deduction, order editing, and third-party push examples. It explains when each pattern applies, how to combine them with idempotency, and provides concrete SQL and Redis implementations.

7 min read

WXG First-Round Interview: 60 Questions from Algorithms to Agent Design

A shared WXG first-round interview experience lists 60 questions covering self-introduction, algorithms (IP-to-uint64, linked-list folding, uniform sampling), system design, AI tools, large-model hallucinations, RAG, vector search, collaborative filtering, 12306 ticketing architecture, Redis internals, MySQL B+ trees, concurrency locks, and design patterns.

73 min read

10 System Design Questions That Decide Big Tech Interview Success

This article dissects 10 high-frequency system design questions — seckill, short URL, distributed ID, delayed tasks, leaderboard, real-time push, short-video feed, sharding, rate limiting, and config center — with architecture diagrams, core code, and comparative solutions for each.

14 min read

Why the Creators of Linux, Python, Redis, Nginx & SQLite Are True Geniuses

The article argues that creators of foundational software like Linux, Python, Redis, Nginx, and SQLite are true geniuses due to their exceptional abstraction skills and system-level boundary control, illustrated by real-world cases where their minimal, convergent designs outperform modern complex solutions, and warns that over-reliance on AI tools erodes deep system understanding essential for solving hard production issues.

65 min read

Complete Disk I/O Alert Troubleshooting: From Alert to Root Cause with 5 Real Cases

This article details a complete disk I/O alert investigation in production, covering core concepts like IOPS vs throughput, iostat/iotop analysis, and five real-world cases including MySQL missing indexes, log misconfiguration, backup conflicts, Redis persistence, and filesystem mount options, providing a reusable troubleshooting methodology.

12 min read

Redis Multi-Rule Rate Limiting & Duplicate Submission Prevention in Distributed Systems

This article details a distributed Redis-based solution for enforcing multiple rate-limiting rules simultaneously (e.g., 10 requests per minute and 20 per two minutes) while preventing duplicate submissions, using Zset data structures, Lua scripts for atomicity, and Spring AOP annotations.

36 min read

Scaling Spring Boot Sign-In to 100M Users: Distributed Architecture Evolution & Production Hardening

This article details the evolution of a Spring Boot daily sign-in system from 10K to 100M users, covering Redis bitmap sharding, Lua atomic operations, command outbox pattern, Kafka async reward processing, idempotency guarantees, fault tolerance strategies, and production-grade observability with real incident postmortems.

14 min read

Redis Production Fault Troubleshooting: 8 Critical Issues & Solutions

This article details eight high-frequency Redis production faults—cache penetration, breakdown, avalanche, big keys, hot keys, connection exhaustion, memory OOM, and consistency issues—providing symptoms, root causes, troubleshooting commands, solutions, and a universal SOP for rapid diagnosis and resolution.

28 min read

Spring Boot QR Code Login: State Machines, SSE Push, and Replay Protection for Production

This article details a production-ready QR code login implementation using Spring Boot, covering state machine design with Redis and Lua for atomic transitions, SSE for low-latency status push with polling fallback, HMAC-SHA256 with nonce for replay protection, and Redis Pub/Sub for cross-instance consistency in clustered deployments.

25 min read

Beyond Distributed Locks: Three-Layer Idempotency for Spring Boot Order APIs

The article demonstrates why distributed locks alone fail to guarantee idempotency in Spring Boot order APIs, and presents a three-layer solution combining Idempotency-Key with request fingerprinting, Redis SET NX for fast duplicate interception, and a database unique constraint as the ultimate safeguard against duplicate orders even after crashes or Redis failures.

17 min read

Distributed Rate Limiting with Redis + Lua: Surviving API Floods in Spring Boot

After an external system hammered a Spring Boot search endpoint causing database connection exhaustion, the author builds a distributed fixed-window rate limiter using Redis and Lua for atomicity, wraps it with an annotation-driven AOP aspect supporting user, IP, API key, and global dimensions, returns proper HTTP 429 with Retry-After, discusses fixed-window limitations versus token bucket and sliding window, and covers fail-open/fail-closed strategies for Redis outages plus monitoring metrics.

6 min read

5 Ways to Prevent API Replay Attacks: From Nonces to Idempotency Keys

This article explains five practical solutions to prevent API replay attacks, including unique nonces with Redis storage, timestamp validation, combined signature-timestamp-nonce schemes, backend-issued one-time tokens, and business-level idempotency keys for critical operations like payments.

14 min read

Spring Boot Email Integration: Build Verification Code System with Redis & Thymeleaf

This tutorial walks through email protocols, third-party SMTP setup for Feishu and QQ, Spring Boot mail starter configuration, core JavaMailSender/MimeMessage/MimeMessageHelper relationships, and a complete email verification code implementation using Redis for storage and Thymeleaf for HTML templates.

69 min read

Redis Interview: Why 'Memory + Single Thread' Fails — 12 Core Internals Explained

This comprehensive Redis interview guide covers 12 core internals including memory model, single-threaded architecture, I/O multiplexing, data structures, persistence, replication, clustering, cache pitfalls, distributed locks, consistency patterns, and Redis 6.0/7.0 features with diagrams and source-level insights.

22 min read

Spring Boot Sa-Token Integration: High-Availability Auth with Dynamic Permissions & Replay Protection

This article details integrating Sa-Token 1.37.0 with Spring Boot 2.7.x and Redis 6.x for authentication, covering dependency setup, configuration, login implementation, dynamic permission via StpInterface, API replay protection using nonce/timestamp/signature, cluster deployment, comparison with Spring Security+JWT, and production pitfalls.

18 min read

Why Sa-Token Is Winning Over Spring Security: A Deep Dive into Java's Rising Auth Framework

This article analyzes why Sa-Token has surpassed 46K GitHub stars by comparing its Core-Plugin-Adapter architecture, zero-config startup, and one-line authentication API against Spring Security's steep learning curve, demonstrating how it reduces permission system implementation from weeks to days.

18 min read

How WeChat Resets 1 Billion Step Counts at Midnight Without Crashing

WeChat avoids server crashes during midnight step-count resets for 1 billion users by using logical time-based versioning instead of physical updates, a custom PaxosStore for atomic increments, delayed double-write buffers for clock skew, Redis ZSet sharding for rankings, and asynchronous cold-data archival during low-traffic hours.

35 min read

Troubleshooting High Redis Client Connections: A Step-by-Step Guide to Identification and Optimization

This comprehensive guide details a systematic approach to diagnosing and resolving high Redis client connection counts, covering connection models, configuration tuning, CLI analysis commands, application-level connection pool fixes, temporary mitigation tactics, and long-term monitoring best practices with real-world case examples.

11 min read

Recreating WeChat‑style Message Recall in Spring Boot: Why Deleting Isn’t Enough

The article walks through a complete Spring Boot implementation of WeChat‑like message recall, explaining why a simple DELETE is insufficient and detailing how to use a status flag, conditional UPDATE, WebSocket, Redis/MQ, and multi‑device session management to synchronize recall across all clients, even under concurrency and offline scenarios.

10 min read

Why LRU Evicts the Least Recently Used Page First

The article explains the LRU (Least Recently Used) page‑replacement algorithm, its basis in the locality principle, hit‑rate example, various exact and approximate implementations—including counter, stack, linked‑list, Clock, Aging and Working‑Set methods—its hardware requirements, pros and cons, and practical uses such as a Python cache and Redis eviction policies.

14 min read

Cross-Layer Root Cause Analysis: How STAROps & Yaochi Agent Trace Alerts to Missing Indexes & Blocking Lua Scripts

The article demonstrates how STAROps' full-stack correlation combined with Yaochi Agent's deep database diagnosis enables cross-layer root cause analysis across three real incidents: an RDS missing index, a Redis Lua script blocking the single thread, and an EVAL command causing CPU saturation, showing command-level diagnostic precision.

15 min read

I Finally Deleted the Java Code That Reads the Whole Redis Object to Update One Field

The article explains how the old pattern of GET‑ing an entire JSON string from Redis, deserializing it in Java, modifying a single field and writing it back is inefficient and error‑prone, and shows how Spring Data Redis 4.2’s RedisJsonTemplate lets you update or read individual JSON paths directly, reducing code, network traffic and race‑condition risks.

26 min read

Deduplicating 10 Billion Orders: Bloom Filter + Redis Architecture Deep Dive

This article details a production-grade solution for deduplicating 10 billion order numbers using a sharded Redis Bloom filter with database fallback, covering parameter calculations, cold-start loading, scaling strategies, consistency guarantees, and interview-focused comparisons with offline batch and real-time stream approaches.

9 min read

Redis 8's AI Overhaul: Vector Search, Vector Sets, Semantic Cache & Iris Context Engine

This article analyzes Redis 8's new AI capabilities including vector search with HNSW and int8 quantization, the native Vector Sets data type, LangCache semantic caching for LLM cost reduction, and the Iris real-time context engine for agent memory, with code examples and a comparison of when to use each feature.