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

10 min read

Declarative Locking in Spring Boot: Build a Custom @Lock Annotation for Local and Distributed Concurrency Control

This article demonstrates how to eliminate boilerplate locking code by creating a custom @Lock annotation backed by Spring AOP, supporting both JVM-level ReentrantLock and Redis-based Redisson distributed locks with configurable timeout and lock type.

7 min read

6 PHP 8.6 Features You Can't Miss: Partial Application, Clamp, Async I/O & More

PHP 8.6 introduces six major features: partial function application with the ? placeholder, a clamp() function for value bounding, a Duration class with nanosecond precision, an IO/Poll API for asynchronous event loops, default values for readonly properties, and a SortDirection enum for type-safe sorting, plus additional improvements and a Laravel upgrade checklist.

43 min read

Kaspar's Actor Framework: Zero-Cost Abstractions for Low-Latency HFT

This article dissects the actor framework of Kaspar, an open-source CME-certified futures trading system, revealing five key low-latency design choices—including dual message paths, O(1) dispatch, pre-allocated mailboxes, and per-message-type memory pools—that achieve ~50ns round-trips via fast_send and enable deterministic replay for backtesting.

19 min read

Spring Boot + Doris Stream Load: Real-Time Massive Data Updates with Parallel Processing

This article presents a complete Spring Boot integration with Apache Doris Stream Load for real-time massive data updates, featuring annotation-driven field mapping, parallel batch processing with exponential backoff retry, GZIP compression, and configurable performance tuning.

58 min read

JVM Production Mastery: Parameter Skeleton, Launch Checklist, Incident Cheat Sheet & Promo Plan

This final article in the JVM series assembles a production-ready parameter skeleton for JDK17 G1, a 10-item automated launch check script, a 10-category incident cheat sheet, and a big-promotion contingency timeline, all grounded in source-code analysis of parameter parsing, container awareness, OOM handling, and configuration drift detection.

58 min read

JVM Diagnostic Toolchain: Snapshots, Profilers & Arthas — Costs, Mechanisms & Production SOPs

This article analyzes the JVM diagnostic toolchain across three layers — snapshot tools (jstack, jmap, jcmd), interactive arthas, and continuous profilers (async-profiler, JFR) — explaining each tool's observation mechanism, performance cost, and correct usage order through real incidents, source code, and production SOPs for CPU, memory, and thread issues.

52 min read

JVM JIT & Tiered Compilation: Why Same Bytecode Runs 20x Faster When Compiled

This article explains JVM JIT tiered compilation (Tier 0-4), hotspot detection via dual counters, C1/C2 compiler roles, method inlining as optimization prerequisite, speculative optimizations with deoptimization fallback, and production practices for warmup, logging, CodeCache management, and troubleshooting compilation storms.

17 min read

PHP 8.6 Release: New Polling API, ZTS Boost, Performance Gains & Debugging Upgrades

PHP 8.6 introduces a new epoll-based polling API, cuts ZTS overhead by half, adds VM stack page caching for deep recursion, enables cross-request TLS session reuse, and delivers dozens of microbenchmark-verified performance improvements across string, array, and JSON functions, plus stricter session defaults and enhanced debugging with structured stream errors and JSON error locations.

52 min read

JVM Object Allocation Deep Dive: TLAB, Escape Analysis & Scalar Replacement

This article explores JVM object allocation mechanisms including TLAB fast-path allocation, escape analysis with its three escape states, scalar replacement and lock elision optimizations, allocation rate as the primary driver of GC frequency, six common production allocation sources, and practical JFR profiling techniques for allocation governance.

22 min read

Wrong Candidate List? Don't Rush to Change the Ontology — First Pinpoint the Root Cause

This article presents a systematic methodology for diagnosing incorrect candidate lists in data-driven systems, emphasizing evidence-based root cause analysis over premature ontology changes. It covers distinguishing existing requirements from new use cases, preserving original request context, verifying identity and time validity, tracing errors through data, mapping, rules, queries, and output, and only modifying the ontology when necessary distinctions cannot be expressed.

3 min read

C# Source Generators: Compile-Time Metaprogramming to Replace Reflection

This article explains C# Source Generators, a .NET 5 compile-time metaprogramming feature that generates code during compilation to eliminate runtime reflection overhead, detailing its advantages over reflection and expression trees, typical use cases like INotifyPropertyChanged and serialization, and how to enable it in projects for AOT compatibility.

15 min read

Why Scheduled Batch Jobs Miss Data: The Offset Pagination Bug When Updating Status

A batch job using offset pagination while updating record status from PENDING to DONE silently skips data because each processed page shrinks the result set, causing OFFSET to jump over unprocessed records; the fix is to always query page 0 or use keyset pagination with stable cursors.

11 min read

10 Ruby Performance Benchmarks: Compare Speed with benchmark-ips

This article demonstrates 10 common Ruby performance testing scenarios using the benchmark-ips library, covering arithmetic operations, string handling, array iteration, hash lookups, conditionals, loops, memory allocation, method calls, file I/O, and regex matching, plus advanced features like custom suites and statistical configuration.

8 min read

Event Sourcing Explained: How Systems Rebuild State from Immutable Event Logs

This article explains Event Sourcing, a pattern that stores state changes as an append-only sequence of events rather than current state, detailing event creation, storage, state reconstruction with snapshots, and trade-offs like auditability versus storage overhead.

51 min read

ZGC & Shenandoah: How Concurrent Compaction Delivers Sub-Millisecond GC Pauses

This article explains how ZGC and Shenandoah achieve fully concurrent compaction via colored pointers and load barriers versus forwarding pointers, details allocation stalls and generational ZGC (JDK21), quantifies throughput costs, provides a G1-to-ZGC migration guide with configurations, verification criteria, alerting rules, and includes source-code-level analysis and interview Q&A.

17 min read

Magpie: Local Gateway Pools AI Subscriptions Across Coding Agents

Magpie is a local gateway that pools AI subscriptions like Claude Pro, ChatGPT Plus, and Copilot across coding agents such as Claude Code and Codex, translating protocols, auto-routing via configurable strategies, masking secrets, and atomically rewriting agent configs to eliminate per-agent API keys and quota silos.

56 min read

G1 GC Deep Dive: Region Heap, Pause Prediction, Mixed GC & Production Tuning

This article provides a comprehensive analysis of the G1 garbage collector, covering its region-based heap organization, pause prediction model, CSet selection for Young and Mixed GC, humongous object handling, failure modes leading to Full GC, production tuning parameters for JDK17, log analysis techniques, and key source code insights.

5 min read

Load Balancing Architecture Patterns: Layer 4, Layer 7, and Hybrid Compared

This article explains three load balancing architecture patterns—Layer 4 (transport-layer), Layer 7 (application-layer), and hybrid—comparing their mechanisms, performance trade-offs, typical implementations like LVS and Nginx, and how to combine them for high-concurrency, flexible routing in large-scale systems.

51 min read

JVM GC Deep Dive: Reachability, Tri-Color Marking, Generational Algorithms & STW Mechanics

This article explains JVM garbage collection fundamentals including reachability analysis, tri-color marking, three basic algorithms, stop-the-world mechanics, generational hypothesis, Minor GC flow, promotion paths, collector families from CMS to ZGC, production tuning parameters, log analysis, and HotSpot source code insights for troubleshooting.