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

39 min read

Building a Real-Time Risk Control Decision Engine with Spring Boot: Rule Orchestration, List Services, Feature Computation & Decision Traceability

This article details a production-grade risk control engine built with Spring Boot 3 and Java 17, covering five-layer architecture, DSL-based rule modeling with decision tables, Bloom-filter-accelerated list services, sliding-window real-time feature computation via Redis+Lua, timeout-aware orchestration with tiered degradation, and full decision traceability for audit and tuning.

12 min read

Spring Cache Inconsistency: Write Timing vs Transaction Commit Order

This article explains how Spring's CacheInterceptor and TransactionInterceptor execution order causes cache-database inconsistency when cache writes occur before transaction commit, and presents solutions including explicit order configuration, TransactionAwareCacheManagerProxy, and afterCommit callbacks to ensure cache updates only reflect committed transactions.

23 min read

Complete Java TOTP 2FA Implementation: QR Binding, Replay Protection & Recovery Codes

This article details a production-ready Java implementation of TOTP two-factor authentication covering QR code binding, secret encryption, time-drift handling, replay attack prevention via atomic step consumption, rate limiting, recovery codes with hashed storage, and secure 2FA disable flows requiring re-authentication.

15 min read

SpringDoc vs Swagger: Complete Spring Boot API Documentation Migration Guide

This tutorial explains why SpringDoc replaces the deprecated SpringFox for Spring Boot 2.6+/3.x, demonstrates zero-config setup with springdoc-openapi-starter-webmvc-ui 2.5.0, covers programmatic and declarative API grouping via GroupedOpenApi beans or YAML, and shows how to resolve static resource conflicts with WebMvcConfigurer and SpringSecurity permitAll rules for /swagger-ui/**, /v3/api-docs/**, and /webjars/**.

24 min read

PHP 8.6 New Features: Partial Application, Time\Duration, clamp(), and More

PHP 8.6 introduces partial function application with ? and ... placeholders, a new Time\Duration class for time handling, clamp() for value bounding, readonly properties with defaults, writable constant objects, #[\Override] for constants/enums, __debugInfo() for enums, JSON error location, stream error exceptions, Io\Poll for async I/O, SortDirection enum, URI builder, and numerous performance improvements.

22 min read

Spring Boot Validation Deep Dive: @Valid vs @Validated, Global Exception Handling & Unified Error Contracts

This article dissects Spring Boot's validation system, explaining the dual validation paths for @RequestBody and @RequestParam, the critical differences between @Valid and @Validated, core source code mechanisms, group validation, custom constraints, and a complete global exception handling strategy with a unified error response contract.

29 min read

Spring Boot @Transactional Mastery: Propagation, Failure Modes & Distributed Transactions

This comprehensive guide dissects Spring Boot's @Transactional annotation, covering seven propagation behaviors, eight failure scenarios with root causes, core source code analysis, and distributed transaction patterns including local message tables and RocketMQ transaction messages, with practical order-inventory-points examples.

60 min read

AI Coding in Zero-Tolerance Distributed Storage: Meituan's Review, Debug & Automation Practices

Meituan's infrastructure team shares practical experiences using AI for code review, debugging, and automation in distributed storage systems, detailing where AI excels, where it fails due to missing operational context, and methodological principles for combining AI-generated hypotheses with rigorous verification through tests, integration tests, and runtime logs.

21 min read

Long-Running Tasks: Why Timeout Hacks Fail & What Actually Prevents Crashes

This article explains why treating hour-long tasks as extended short requests fails, detailing required patterns: bounded waiting with heartbeats to prevent connection drops, two-level timeouts (per-step and total), partial failure semantics for batch jobs, explicit artifact ownership to avoid cross-session contamination, and acknowledges the critical lack of checkpointing/resume, advising task decomposition instead.

39 min read

Designing Production-Grade APIs: Contracts, Security, Idempotency & Rate Limiting with Code

This comprehensive guide covers designing production-ready APIs from contract design and security (HMAC-SHA256 signatures, nonce replay protection) to idempotency (five patterns with Redis Lua), distributed rate limiting (token bucket, sliding window), observability (TraceID, logging, monitoring), and versioning strategies, with production-ready Java code examples.

38 min read

Building an Enterprise Alert Center with Spring Boot: Convergence, Silencing, On-Call & Escalation

This article details a Spring Boot-based enterprise alert center architecture covering alert ingestion, standardization, four-layer convergence (deduplication, grouping, inhibition, silencing), routing, multi-channel notification, on-call scheduling, escalation policies, and closed-loop governance with SLO integration.

9 min read

Why OntoL 8.0's Memgraph Community + Custom DSL Is a Brilliant Technical Choice

The article argues OntoL 8.0's choice of Memgraph Community Edition and a custom DSL over distributed graph clusters is optimal because ontology workloads fit within single-node capacity, avoiding operational complexity that exceeds organizational maintenance ability, while pushing optimizations to the software layer for sustainable evolution.

16 min read

Why MCP and Workflows Aren't Enough: Defining Business Action Contracts

The article explains why Model Context Protocol (MCP) and workflows alone cannot enforce business rules like parameter provenance, approval validation, idempotency, and result verification, using a procurement example to illustrate the need for explicit Action contracts that define conditions, approvals, and error handling.

7 min read

Spring's Hidden Async Alternative to MQ: Built-in Events for In-Process Decoupling

This article explains how Spring's built-in event mechanism provides a lightweight alternative to message queues for in-process asynchronous decoupling, covering synchronous vs asynchronous handling, transactional event listeners, thread pool configuration, lifecycle events, and when persistent solutions are needed.

21 min read

Complete Java Passkey Implementation: Registration, Auth, Anti-Replay & Multi-Device

This article provides a complete Java implementation guide for Passkey passwordless authentication, covering credential registration with challenge generation, public key storage, signature verification, anti-replay protection via one-time challenges, multi-device credential management, account recovery considerations, Spring Security WebAuthn integration, and a layered authentication architecture separating auth methods from session management.

11 min read

AI Codes Fast, But Debugging Doesn't: Why Logs Are Essential

The author shares a real incident where AI-generated code caused a production issue, demonstrating that while AI accelerates coding, debugging speed depends on runtime logs; the article outlines five key scenarios requiring logging—data filtering, fallbacks, precondition failures, empty queries, and cross-system calls—to give AI the context needed for rapid root-cause analysis.

48 min read

Embedding DuckDB in Spring Boot: Ad-hoc Parquet/CSV Analytics with Multi-tenant Isolation

This article details integrating DuckDB into Spring Boot for embedded OLAP analytics, covering tenant-isolated connection pools, secure view-based file access, streaming exports via COPY and cursors, SQL injection guards, and performance tuning for ad-hoc Parquet/CSV queries without a separate cluster.