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

15 min read

Choosing a Java Garbage Collector: Which Metric Are You Optimizing For?

This guide explains Java garbage collector internals and selection criteria, covering Serial, Parallel, G1, ZGC, and Shenandoah, detailing their trade-offs between throughput, latency, and memory overhead, and provides scenario-based recommendations for microservices, low-latency systems, batch processing, and small containers, including upcoming Java 27 defaults.

9 min read

Four Mental Models to Deconstruct Financial Architecture

This article presents four reusable reasoning models for financial system architecture: phased FX cost optimization via netting, Boolean logic for regulatory boundary analysis, anemic vs rich domain model trade-offs for cross-module data transfer, and decomposing FX transactions into paired same-currency payments to simplify complex designs.

40 min read

Production-Grade Message Bus with Go & NATS JetStream: Transactions, Ordering & Recovery

This article details a production-ready messaging architecture using Go and NATS JetStream, covering transactional outbox publishing, consumer idempotency via inbox tables, aggregate version ordering strategies, quarantine and recovery workflows, Kubernetes R3 deployment, capacity planning, and acceptance testing against failure injection scenarios.

37 min read

Why Stale Workers Still Cause Failures: Lease, Fencing & Outbox Patterns for Go + PostgreSQL

This article presents a production-grade design for handling long-running, preemptible worker tasks in Go and PostgreSQL, covering lease protocols, fencing tokens, outbox patterns, and side-effect reconciliation to prevent stale workers from corrupting state or duplicating external operations.

15 min read

Java vs Python: Why You Should Extend, Not Switch, for AI & Data

This article analyzes whether Java developers should switch to Python, distinguishing three motivations—AI application development, data analysis/automation, and career dissatisfaction—and argues for extending skills with Python rather than switching, detailing ecosystem boundaries, a real-world SaaS architecture, and practical learning targets.

8 min read

Enforce Spring Boot Architecture Rules Automatically with ArchUnit

This tutorial demonstrates how to use ArchUnit to automatically enforce architectural constraints in Spring Boot projects, covering package structure validation, layered architecture protection, cycle detection between modules, and blocking problematic dependencies like BigDecimal(double) constructor through automated tests.

14 min read

Insert 300K Records in 13 Seconds: The Right Way to Batch Insert

The article benchmarks multiple approaches for inserting 300,000 records into MySQL, showing that naive single inserts take over 4 hours, while optimized batched inserts using MyBatis or JDBC with proper batch sizes (1000–5000) and transaction management achieve 13–24 seconds, and summarizes key optimization strategies.

39 min read

Designing Go WeChat Mini Program Login for 50k QPS: Distributed Sessions & Async Peak Shaving

This article details a high-throughput WeChat Mini Program login architecture in Go targeting 50k entry QPS, covering distributed session design, async peak shaving with Kafka, capacity modeling using Little's Law, API contracts for sync/async flows, idempotency, transactional outbox, token management, observability, and load testing strategies.

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.

6 min read

AI Audit Uncovers 9 Silent Bugs in Feat Framework

The author used AI to audit the Feat framework, uncovering 9 issues including connection reuse state leaks and security vulnerabilities, all fixed with automated tests, while reflecting on AI's role as a tireless code reviewer and the importance of invisible stability in foundational frameworks.

10 min read

5 Java Thread Communication Techniques: From volatile to LockSupport

This article explains five Java thread communication methods—volatile flag, Object wait/notify, CountDownLatch, ReentrantLock with Condition, and LockSupport—with runnable code examples showing how each coordinates a producer thread adding items and a consumer thread triggered at the fifth addition.

12 min read

Why PreToolUse Misses Direct Slash Commands: The Prompt-Layer Fix

The article explains how Claude Code's slash commands bypass PreToolUse hooks, requiring UserPromptExpansion for interception, details skill rendering-phase command execution and permission checks, and covers the 2.1.299 change moving UserPromptSubmit before command expansion.

10 min read

Netty 4.2: Architectural Overhaul with io_uring, Adaptive Allocator, and Breaking Changes

Netty 4.2 delivers a major architectural rewrite after 10 years: event loops decoupled from transports via IoHandlerFactory, io_uring graduates from incubator with kernel-level batching, the default memory allocator switches to adaptive magazine-style caching, and TLS hostname verification becomes strict by default — all requiring careful migration due to API breakages and classpath incompatibility.

22 min read

Spring Annotation-Only Integration with MyBatis and JUnit

This tutorial demonstrates how to integrate Spring with MyBatis and JUnit using only annotations, covering Maven dependencies, Druid data source configuration, MyBatis SqlSessionFactory setup, mapper scanning, dynamic SQL with @SelectProvider, service layer wiring, and JUnit test execution with Spring's test context framework.

12 min read

AST + LLM Automate Legacy Refactoring: Strangler Pattern Achieves 72% Decoupling Automation

AsiaInfo's AST-guided LLM agent automates legacy Java refactoring via strangler pattern, identifying leaf modules through static analysis, generating clean architecture code with sandbox-verified unit tests, and routing traffic gradually, achieving 72% decoupling automation and cutting regression faults from 4.8% to 0.3% in a 124k-line BSS module.