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

Backend Development

11 min read

Unified Operation Logging with Annotation-Driven Field Diff Detection in Java

This article presents a unified operation logging framework using Java annotations and reflection to automatically detect field changes between object states, generating structured audit logs for create, update, and delete actions with customizable field formatting and nested object support.

48 min read

Building a Lightweight Workflow Engine for Dynamic Approvals with Java 21 and Spring Boot

This article details the design and implementation of a lightweight workflow engine using Java 21, Spring Boot, and MySQL, covering JSON-based process definitions, versioning, dynamic assignee resolution, multi-approval modes with concurrency control, condition evaluation, node transitions, rejection/resubmission patterns, timeout reminders, and event-driven integration with business systems.

13 min read

Why 80% of Kafka Pitfalls Trace Back to Partitions

This article explains how Kafka's partition model underpins four common issues—consumer parallelism limits, message ordering, rebalance storms, and lag buildup—and provides Spring Boot configuration patterns for reliable production and consumption with manual offset commits, idempotent producers, and dead-letter handling.

78 min read

Spring 7.0.8 Source Code Reading Guide: Setup, Modules & 6 Core Deep Dives

A comprehensive guide to reading Spring Framework 7.0.8 source code, covering environment setup with JDK 25/Gradle, module architecture overview, six core modules (core, beans, context, AOP, tx, webmvc) deep dive with key classes and debugging breakpoints, reading methodology, interview Q&A, and Spring 7.0 new features.

3 min read

Why You Can't Inject Scoped Services in Middleware Constructors (And How to Fix It)

ASP.NET Core middleware is instantiated once at startup, so injecting Scoped services like DbContext in the constructor causes captive dependency—shared instances across requests lead to connection pool exhaustion and data corruption; instead, inject Scoped services via InvokeAsync parameters to get per-request instances.

35 min read

Building a Production-Grade Online Exam Anti-Cheating System with Java 21 & Spring Boot

This article details the design of a scalable online exam anti-cheating system using Java 21, Spring Boot, MySQL, Redis, and WebSocket, covering identity verification, session management, random paper generation, screen-switch detection, heartbeat monitoring, answer versioning, server-side timing, risk-based anomaly analysis, and deployment architecture for 5000 concurrent examinees.

16 min read

MQ Selection: Three Questions That Decide 80% of Your Choice

This article provides a practical framework for selecting a message queue by first answering three critical questions about message loss tolerance, semantic requirements, and operational capacity, then comparing RabbitMQ, Kafka, and RocketMQ across six dimensions, highlighting why backlog capacity matters more than throughput, and listing five real-world anti-patterns to avoid.

20 min read

AI + Rust: When Does Rewriting Legacy Software Pay Off?

Anthropic migrated its Messages API from Python to Rust, cutting per-request CPU by 70% and memory by over 80%, but the migration took months despite AI writing the first version in a week; the article analyzes runtime savings, cross-language overhead, verification challenges, and break-even calculus for AI-assisted rewrites.

8 min read

Java to Rust Migration: 5x Throughput, 75% Server Reduction, Real-World Trade-offs

A team migrated a high-load Java microservice to Rust after GC pauses caused high CPU and costs; benchmarks showed Rust achieved 2-5x higher throughput on 1-2 servers vs 8 Java servers, cutting annual cloud costs by ~200k RMB, but required a steep learning curve, slower initial development, and strict code reviews.

55 min read

Go Priority Task Scheduler: Fair Scheduling, Backpressure & Verifiable Shutdown

This article details the design and implementation of a bounded, non-preemptive Go priority task scheduler with weighted fair queuing, backpressure handling, graceful shutdown protocols, Kafka integration patterns, and comprehensive verification strategies for production reliability.

13 min read

Fast-Anything: AI-Ports Your Slowest 5% to Rust, Verified by Real Call Replay (116x)

Fast-Anything is an open-source CLI tool that uses AI agents to port only the hottest, pure functions from Python, Node, Ruby, etc. to Rust, verifies correctness by replaying up to 500 real calls plus edge cases, and enables reversible, per-function Rust crates—delivering up to 116x speedups while avoiding full rewrites.

52 min read

Agent-Driven Code Governance: 43% Business Code Reduction in Tencent Backend

Tencent's advertising team built an agent-based continuous code governance process that reduced business code by 43.42%, improved architecture health from 53.5 to 69.1, cut microservices from 25 to 16, and eliminated 85% of unreferenced functions through scheduled scanning, rule-based agent execution, and automated line-by-line review with deterministic evidence.

37 min read

Java Concurrency in Production: Post-Mortem, Decision Trees & Automated Checklists

This final episode of a 10-part Java concurrency series uses a flash sale post-mortem with three simultaneous failures to demonstrate how to convert scattered knowledge into team-wide capability through decision trees, automated checklists, and runtime guardrails.

45 min read

Deadlock, Livelock & CPU 100%: Java Concurrency Troubleshooting with jstack & Arthas

This guide covers systematic concurrency troubleshooting: diagnosing deadlocks via Coffman conditions and ThreadMXBean patrols, resolving CPU 100% spikes with a five-step jstack/Arthas workflow, distinguishing livelock from starvation, detecting thread leaks via heap dumps, and implementing monitoring templates for production readiness.

52 min read

Multi-Agent in Production: Java Engineering Patterns for State, Idempotency & Safety

This article details production-grade multi-agent architectures for Java backends, covering when to split agents, six high-ROI scenarios, topology patterns (Supervisor, Pipeline, Map-Reduce, Debate), communication protocols, framework selection (Spring AI, LangChain4j, LangGraph4j), and core code for orchestration, checkpointing, idempotency, and observability.

20 min read

Spring AI 2.1: Human-in-the-Loop Tool Calls, Ordered Message Parts & DecisionModel

Spring AI 2.1 introduces framework-level tool call confirmation for human-in-the-loop agent safety, ordered Message Parts to preserve model reasoning order across providers, OpenAI Responses API support for combined tool use and reasoning, and a new DecisionModel interface for probabilistic classification tasks.

25 min read

Real-Time Dispatch System Design: Spring Boot, Redis GEO, Concurrency & Timeout Handling

This article details the design of a real-time ride-hailing dispatch system using Spring Boot, Redis GEO for driver location, two-phase candidate selection, time-bound dispatch invitations, database transaction-based concurrency control for order acceptance, timeout-based redispatch rounds, WebSocket location tracking, and cancellation handling, emphasizing data consistency over raw proximity.