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

22 min read

Spring Boot Trusted Device Login: Why Device ID Isn't Enough for 30-Day Remember Me

This article details a secure implementation of 'remember this device for 30 days' in Spring Boot, explaining why device IDs and fingerprints are insufficient, and demonstrating server-signed trusted device tokens with hashed storage, rotation, absolute expiration, MFA versioning, and revocation mechanisms to properly bypass 2FA without compromising security.

6 min read

Java CyclicBarrier: Reusable Thread Barrier with Callback for Parallel Aggregation

This article explains Java's CyclicBarrier synchronization utility, highlighting its reusability and callback support compared to CountDownLatch, and demonstrates its use in two examples: a basic three-thread barrier with a callback and a parallel array sum calculation where threads compute partial sums and aggregate at the barrier.

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.

14 min read

Why @EnableWebMvc Disables Spring Boot's Web MVC Auto-Configuration

This article explains how @EnableWebMvc imports WebMvcConfigurationSupport, triggering @ConditionalOnMissingBean to skip WebMvcAutoConfiguration entirely, causing loss of static resource mapping, custom message converters, content negotiation, and spring.mvc.* properties, while showing the correct pattern of implementing WebMvcConfigurer without the annotation.

15 min read

Why ZXing Dominates QR Code Scanning: A 19-Year-Old Java Library's Rise

This article explores why ZXing, a 19-year-old Java barcode library with 34k GitHub stars, became the de facto standard for QR code generation and scanning in apps like WeChat and Alipay, covering its encoding/decoding internals, Android architecture, comparison with ZBar and OpenCV, pros/cons, and ideal use cases.

19 min read

Why 'Completed' Doesn't Mean Done: Verifying Order Creation After Timeouts & Retries

This article explains why an AI agent's 'completed' message can hide duplicate purchase orders after API timeouts, detailing how to verify actual creation status, implement idempotent retries with stable request IDs, distinguish cancellation from revocation, and test failure scenarios using concrete examples like REQ01 and PO8601.

37 min read

Building a Spring Boot Ticket & SLA Platform: Multi-Channel, Auto-Dispatch, Escalation

This article details the architecture of a Spring Boot-based customer service ticket and SLA platform, covering unified ticket modeling across four channels, domain entities with SQL schemas, adapter-pattern channel integration, skill-based auto-dispatch with load balancing, business-calendar-driven SLA timing with pause/resume and staged escalation via delayed queues, collaboration features, satisfaction surveys, and quality inspection.

16 min read

Why Spring Boot's /tmp Fills Up Even When Streaming Files to MinIO

Spring Boot's multipart parser writes uploads to disk before your controller runs, filling /tmp during concurrent large files; the fix is direct browser-to-object-storage uploads via presigned URLs, plus temp directory isolation, concurrency limits, and content validation.

20 min read

RuoYi Entity Base Classes: BaseEntity Audit Fields & TreeEntity Inheritance Design

This article analyzes RuoYi 3.9.2's BaseEntity and TreeEntity base classes, showing how audit fields, a dynamic params Map, and tree-specific fields are consolidated to eliminate boilerplate across hundreds of entities, with concrete MyBatis mapper examples and design trade-off discussions.

24 min read

API Security: HMAC Signatures, Anti-Replay & Idempotency with Spring Boot & Redisson

This article provides a comprehensive implementation guide for securing APIs using HMAC-SHA256 signatures, timestamp and nonce anti-replay mechanisms, appId/appSecret credential management, constant-time comparison to prevent timing attacks, and business idempotency patterns with Spring Boot 3.2.4 and Redisson.

43 min read

Distributed Locks & Leader Election with Curator: Pitfalls, Fair Locks & Fencing Tokens

This article analyzes distributed locks and leader election using Apache Curator, detailing three failure scenarios (false release, herd effect, lock loss), fair vs herd lock implementations, fencing tokens for correctness, Curator's lock family, source code walkthroughs, and practical pitfalls with interview Q&A.

50 min read

ZooKeeper Watch Mechanism & Curator Best Practices: Solving Herd Effect & Connection Pitfalls

This article analyzes ZooKeeper's watch mechanism through three production accidents — one-time triggers, herd effect, and missed events during disconnection — then explains Curator's cache abstractions, session vs connection lifecycles, reconnection rebuild process, and three-layer solutions to herd effect with troubleshooting commands and interview questions.

48 min read

ZooKeeper & ZAB Protocol Deep Dive: Leader Election, Crash Recovery, and Write Path Internals

This comprehensive analysis dissects ZooKeeper's architecture, the ZAB consensus protocol, leader election mechanics, write request lifecycle, crash recovery guarantees, and operational pitfalls through real-world failure scenarios and source code walkthroughs.

8 min read

Why Java Microservices Randomly Disappeared: A Linux Kernel Bug Hunt

The author details a week-long investigation into random microservice disconnections in a Spring Cloud Alibaba cluster, systematically ruling out memory, CPU, disk, network, Nacos server, and client versions before discovering a Linux kernel bug causing JVM hangs that silently dropped heartbeats, resolved by upgrading the kernel.

44 min read

Netty Heartbeat & Idle Detection: Stopping Fake-Alive Connections at Million Scale

This article dissects three production incidents caused by missing heartbeats, over-frequent heartbeats, and misconfigured idle thresholds, then provides a complete design for application-layer heartbeats using Netty's IdleStateHandler, including timer mechanics, exponential backoff with jitter, kernel/Netty tuning parameters, and a troubleshooting guide for connection states.

40 min read

Netty Framing Deep Dive: LengthFieldBasedFrameDecoder, TCP Stick/Unpack, and Protocol Pitfalls

This article analyzes three real-world Netty framing failures — half-pack JSON parsing, fixed-length decoder misalignment, and unbounded length-field OOM — then explains TCP's lack of message boundaries, compares three framing strategies, details LengthFieldBasedFrameDecoder's five parameters with diagrams, walks through ByteToMessageDecoder's cumulation and callDecode loop, shows Dubbo/gRPC protocol headers, and lists eight common codec pitfalls with fixes.

53 min read

Frontend to Java Full-Stack: AI-Powered 2-Day Demo & Pitfall Guide

A frontend developer shares a practical roadmap for transitioning to Java full-stack development using AI assistance, covering mental model mapping, tech stack selection (Spring Boot 3, JPA/MyBatis-Plus), 30-minute MVP workflow, backend core patterns (unified response, global exceptions, layered architecture), frontend integration (Vite proxy, axios, OpenAPI type generation), JWT/Spring Security pitfalls, AI prompt engineering, and 24 real-world pitfalls with solutions.