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

14 min read

Why Message Duplicates Are Inevitable: 4 Idempotency Patterns & 3 Critical Pitfalls

At-least-once delivery makes duplicates unavoidable; this article details four idempotency patterns—database unique index, consumption log table, Redis SETNX, and state machine—with code examples, and warns of seven pitfalls including transaction boundaries, acknowledgment handling, and key selection.

46 min read

Actor Model on FPGA: How Kaspar Maps Actors to Hardware for Trading

This article details how the Kaspar open-source futures trading system implements the actor model on FPGA, covering FPGA architecture, high-level synthesis, process/FIFO communication, hardware actors, group mapping, CPU-FPGA differences, PCIe link optimization, and cross-device actor messaging via direct memory access.

54 min read

Go Real-Time Logistics Dispatch: Architecture Evolution & Production-Grade Design

This article presents a production-grade reference design for a Go-based real-time logistics dispatch system, covering architecture evolution from location floods to reliable order assignment, spatial sharding with S2, matching algorithms, atomic transaction protocols, message reliability, Go concurrency control, recovery strategies, and acceptance criteria.

48 min read

Production Agent Tool Authorization: From Roles to Verifiable Execution

This guide details a production-grade authorization framework for agent tool calls, covering capability requests, trusted fact separation, delegation chains, policy evaluation with deny-overrides, execution credentials binding, CEL vs OPA trade-offs, caching with revocation, signed policy deployment, split audit logs, and phased rollout with acceptance testing.

16 min read

Anthropic's Rust Migration & AI-First Engineering: No Coding Interviews, PMs Ship Features

Anthropic platform lead Katelyn Lesse reveals how a small team migrated the Messages API from Python to Rust in five months using shadow testing, replaced traditional code reviews and oncall with Claude agents, let product managers ship features directly, and shifted hiring and promotion to focus on impact over tenure — all while keeping team size and ownership unchanged.

43 min read

CompletableFuture Async Orchestration: Avoiding Three Production Disasters

This article dissects Java's CompletableFuture through three real production incidents, covering its state machine, callback semantics, thread pool pitfalls, exception propagation, DAG orchestration patterns, timeout control, context propagation, and source code internals with practical templates and a seven-point safety checklist.

50 min read

CAS & Atomic Classes: Spin Optimism vs Blocking Pessimism

This article analyzes CAS and Java atomic classes through three production incidents, covering hardware-level lock cmpxchg, spin-loop internals, ABA problems, LongAdder's segmented counting, AtomicStampedReference, field updaters, and a seven-point checklist for safe CAS usage, with source code walkthroughs and interview Q&A.

46 min read

Mastering Java Concurrent Containers: CHM Internals, CopyOnWrite, and Queue Selection

This article analyzes Java concurrent containers through three production incidents, detailing ConcurrentHashMap's CAS and fine-grained locking, CopyOnWriteArrayList's copy-on-write semantics, BlockingQueue selection guidelines, and provides migration templates and a 7-point review checklist for safe container usage.

51 min read

Thread Pool Deep Dive: Worker AQS, Dynamic Tuning, Rejection & Load Testing

This article analyzes three production thread pool incidents, explains Worker AQS internals, details dynamic parameter tuning semantics, queue sizing and rejection strategies, monitoring metrics, and a five-step tuning loop with practical code templates for dynamic scaling, timed adjustments, custom rejection handlers, and observability.

10 min read

JDK 28 Drops Primitive Pattern Matching After 5 Previews — Valhalla Conflict Cited

JDK 28 withdraws JEP 532 (Primitive Types in Patterns, instanceof, and switch) after five preview rounds because Project Valhalla's evolving numeric model may conflict with its exact numeric conversion semantics; the Amber team plans Constant Patterns as an alternative, retaining some gains.

46 min read

Java AQS & Lock Deep Dive: Synchronized Gaps, CLH Queue, and Production Patterns

This article explains Java's AbstractQueuedSynchronizer (AQS) as the foundation for ReentrantLock, Semaphore, and other concurrency tools, detailing its volatile state, CAS, CLH queue mechanics, acquire/release flows, fair vs unfair locking, Condition queue transfer, and production patterns like tryLock timeout fallback and ReadWriteLock usage, with real incident case studies.

12 min read

Redis Multi-Rule Rate Limiting: Sliding Window, Lua Atomicity & Duplicate Prevention

This article demonstrates how to implement distributed multi-rule rate limiting and duplicate submission prevention in Redis using sorted sets and Lua scripts for atomic operations, covering annotation-based configuration, sliding window algorithms, concurrency handling, and boundary condition solutions with complete Java and Lua code examples.

4 min read

How ASP.NET Core Builds Its Middleware Pipeline: The Reverse-Nesting Secret

This article explains how ASP.NET Core constructs its middleware pipeline by reverse-nesting RequestDelegate functions in IApplicationBuilder.Build(), causing requests to flow forward in registration order and responses to flow backward, which dictates why components like UseExceptionHandler must be registered first.

15 min read

RocketMQ's Real Value: Native Delayed Messages, Transactions & Built-in Retry/DLQ

This article explains why RocketMQ is chosen for its native delayed messages, transaction messages, and built-in retry/dead-letter queues rather than throughput, covering architecture, Docker deployment, Spring Boot integration, delayed message patterns for order cancellation, transaction message flow with half-messages and broker check-back, and seven common pitfalls with solutions.

14 min read

PHP WASM Builder 1.0: Compile PHP to WebAssembly for Browser and Node.js

php-wasm-builder 1.0 enables compiling PHP with custom versions and extensions into a single WebAssembly module that runs in browsers and Node.js without a PHP server, demonstrated by running Symfony apps and PHP libraries entirely client-side via static hosting.

36 min read

Volatile & JMM: The Visibility Bedrock of Java Concurrency — From Bugs to Barriers

This article explores Java Memory Model (JMM) and volatile through three real production incidents, explaining visibility, ordering, and atomicity guarantees, happens-before rules, memory barriers, and practical patterns like safe publication and double-checked locking, with a four-question checklist and eight-point code review guide.

52 min read

Java synchronized Deep Dive: Lock Mechanics, Upgrades, Deadlocks & Production Checklists

This article analyzes three real-world concurrency accidents to explain synchronized's lock essence, Mark Word upgrade mechanism, proper lock object selection, wait/notify cooperation, deadlock prevention via global ordering, and provides production-ready templates including a three-question design checklist, four code patterns, and an eight-point code review checklist.

37 min read

Java Thread Pool Mastery: 3 Production Incidents, Source Code & Operational Playbook

This comprehensive guide analyzes three real thread pool incidents (OOM, CPU thrashing, silent latency), dissects ThreadPoolExecutor source code, provides calibrated configuration templates with bounded queues and custom rejection handlers, explains thread count calibration via load testing, and establishes monitoring, isolation, and graceful shutdown practices for production readiness.

12 min read

Distributed Multi-Rule Rate Limiting & Duplicate Prevention with Redis ZSet & Lua

This article demonstrates how to implement distributed multi-rule rate limiting and duplicate submission prevention using Redis sorted sets and atomic Lua scripts, covering annotation design, key generation, concurrency handling, and two Lua implementation strategies with retry logic for timestamp collisions.