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

13 min read

Spring Boot Multi-Tenant: Database Isolation, Dynamic DataSource Routing & Spring Cloud

This article explains how to implement multi-tenant architecture using Spring Boot and Spring Cloud, covering database isolation strategies, dynamic data source routing with AbstractRoutingDataSource, tenant management, security configuration, and deployment considerations for SaaS applications.

17 min read

Spring MVC @ControllerAdvice: Exception Matching Order, Coverage Scope & Source-Code Deep Dive

This article explains how Spring MVC's @ControllerAdvice selects exception handlers by inheritance depth, how @Order prioritizes multiple advice classes, which scope attributes limit coverage, and why Filter exceptions, 404 errors, and afterCompletion interceptor exceptions escape global handling.

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.

18 min read

Stream.toMap() Duplicate Key Crash: Why the Common Fix Silently Loses Data

A duplicate phone number in a 5000-row Excel import caused Stream.toMap() to throw IllegalStateException; the typical merge-function fix silently discards data, so the article presents a robust validation pipeline using groupingBy, key normalization, batch database checks, and explicit error reporting to handle duplicates correctly.

21 min read

JSONL vs JSON: When Line-Delimited JSON Wins for Logs and ML Data

This article compares JSONL (JSON Lines) with regular JSON, explaining how line-delimited records enable memory-efficient streaming for logs, machine learning datasets, and ETL pipelines, while detailing tool support in pandas, Spark, and Hugging Face, and clarifying when to stick with standard JSON.

17 min read

RuoYi BaseController: Template Method Pattern for Unified Controller Logic

This article analyzes RuoYi 3.9.2's BaseController class, which encapsulates common controller operations like date binding, pagination, response handling, and user context retrieval using the template method pattern, enabling consistent CRUD controller implementations across the framework.

38 min read

Netty ByteBuf Deep Dive: Pooling, Reference Counting & Zero-Copy Explained

This article analyzes Netty's ByteBuf memory management through three real-world incidents, covering pooling algorithms, reference counting semantics, off-heap vs heap trade-offs, zero-copy techniques, leak detection internals, and a 7-step message lifecycle with source-code walkthroughs.

6 min read

Why Dependency Injection Thrives in Java But Not Go or C++: IoC Trade-offs

The article explains that dependency injection is just one inversion-of-control pattern; Java adopts DI due to its object-oriented purity and reflection-enabled runtime frameworks, while Go and C++ prefer lighter callbacks, closures, and compile-time abstraction via headers, making DI frameworks less necessary despite the pattern's universal value for decoupling and testing.

53 min read

Spring Cloud Gray Release: Beyond Gateway Routing to Full-Chain Context Propagation

This article analyzes three real-world gray release failures in Spring Cloud, revealing that successful gray release requires full-chain context propagation, traffic-proportion accuracy, and bidirectional data compatibility—not just gateway routing. It covers implementation details, LoadBalancer filter chains, fallback strategies, database migration patterns, and troubleshooting techniques.

39 min read

LLM Autoregressive Generation Deep Dive: From Next-Token Prediction to Java Streaming Implementation

This article explains LLM autoregressive generation principles including next-token prediction, KV Cache optimization, sampling strategies (temperature, top-k, top-p), and provides complete Java implementations for streaming token generation with Spring AI, WebFlux, and virtual threads.

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.

18 min read

Spring Boot @ConfigurationProperties: Binding Timing, Validation & Internals Deep Dive

This article explains Spring Boot's @ConfigurationProperties binding mechanism, covering when binding occurs via BeanPostProcessor, how Binder handles relaxed binding and type conversion, differences between setter and constructor binding, validation triggering with @Validated, and common troubleshooting pitfalls.

11 min read

Spring Async Streaming: ResponseBodyEmitter, SseEmitter, and StreamingResponseBody Explained

This article explains three Spring mechanisms for asynchronous streaming responses—ResponseBodyEmitter for progressive data sending, SseEmitter for server-sent events with auto-reconnect, and StreamingResponseBody for large file streaming—with code examples and use cases for each.

10 min read

Designing a Secure Invite-Friend Referral System: Token-Based Flow & Database Schema

This article details the backend implementation of a viral 'invite friends to help' marketing campaign, covering the share-token flow, three MySQL table designs for tracking shares, visits, and successful assists, and the security rationale for using tokens over direct user IDs.

34 min read

Building a Robust Member Points System with Spring Boot: Account Model, Idempotency & Reconciliation

This article details a production-grade member points and growth system built on Spring Boot, covering account modeling with ledger tables, batch-based expiration, FIFO deduction, idempotency keys, freeze/unfreeze flows, high-concurrency Redis pre-deduction with async DB persistence, anti-fraud layers, and a three-equation reconciliation framework with automated repair.

21 min read

Beyond Chatbots: Building Production-Grade AI Contract Review in Java

This article details a complete Java architecture for AI-powered contract review, covering PDF parsing, text normalization, structured LLM output with enums and records, chunking long documents, async task processing with retries, business rule validation, human-in-the-loop workflows, and feedback capture for continuous improvement.