Programmer XiaoFu
Author

Programmer XiaoFu

xiaofucode.com – a programmer learning guide driven by the pursuit of profit

104
Articles
0
Likes
73
Views
0
Comments
Recent Articles

Latest from Programmer XiaoFu

100 recent articles max
Programmer XiaoFu
Programmer XiaoFu
Mar 3, 2026 · Backend Development

Why Can a Redis Lock Be Stealed by Another Thread Before Its TTL Expires?

In high‑concurrency Java services, a Redis lock that appears to have a valid TTL can still be taken by another thread when a long Stop‑The‑World pause freezes the JVM clock, causing the lock to expire on Redis while the original holder remains paused, leading to data races.

Fencing TokenOptimistic LockWatchdog
0 likes · 8 min read
Why Can a Redis Lock Be Stealed by Another Thread Before Its TTL Expires?
Programmer XiaoFu
Programmer XiaoFu
Jan 21, 2026 · Databases

How to Add a Column to a Tens‑Million‑Row Order Table Without Locking It

When a tens‑million‑row order table needs a new business column, directly running ALTER TABLE can lock the table and disrupt services, so the article explores master‑slave promotion, online DDL tools, schema‑less JSON extensions, and a clever use of an existing redundant column to achieve the change safely.

DDLJSONMySQL
0 likes · 7 min read
How to Add a Column to a Tens‑Million‑Row Order Table Without Locking It
Programmer XiaoFu
Programmer XiaoFu
Dec 25, 2025 · Backend Development

Seamless Multi‑OSS Switching with Adapter Pattern and Nacos Dynamic Configuration

The article demonstrates how to use the Adapter design pattern together with Nacos dynamic configuration to enable transparent switching among multiple OSS providers (MinIO, Alibaba Cloud OSS, etc.) in a Spring Cloud micro‑service, preserving low coupling and supporting hot reload without code changes.

Adapter PatternDynamic ConfigurationJava
0 likes · 12 min read
Seamless Multi‑OSS Switching with Adapter Pattern and Nacos Dynamic Configuration
Programmer XiaoFu
Programmer XiaoFu
Dec 22, 2025 · Operations

Speed Up Log Searching: A Practical awk, tail, grep, and sed Toolkit

When a colleague struggles with a 2 GB log file, the author demonstrates how to combine tail, less, grep, sed, and awk commands to quickly locate errors, extract time windows, count occurrences, and analyze traffic, turning cumbersome log inspection into an efficient, repeatable workflow.

Linuxawkgrep
0 likes · 8 min read
Speed Up Log Searching: A Practical awk, tail, grep, and sed Toolkit
Programmer XiaoFu
Programmer XiaoFu
Dec 18, 2025 · Fundamentals

How to Roll Back Pushed Git Commits: Practical Methods

The article explains four ways to undo code that has already been pushed to a remote Git repository—including manual diff deletion, using git revert, creating a new branch, and resetting the current branch—detailing each method’s steps, trade‑offs, and safety considerations.

GitIDEAVersion Control
0 likes · 7 min read
How to Roll Back Pushed Git Commits: Practical Methods
Programmer XiaoFu
Programmer XiaoFu
Nov 14, 2025 · Information Security

Why This Permission System Is So Elegant: A Comprehensive Guide to RBAC Design

The article walks through the motivations for strict permission management, explains how to structure menus, buttons, and roles into a tree, explores classic RBAC, role inheritance, constrained RBAC, user groups, organizations and positions, and finally shows how to model these concepts in database tables.

RBACaccess controlorganization hierarchy
0 likes · 17 min read
Why This Permission System Is So Elegant: A Comprehensive Guide to RBAC Design
Programmer XiaoFu
Programmer XiaoFu
Nov 10, 2025 · Backend Development

Why Ignoring SpringBoot’s Default Settings Guarantees Trouble

SpringBoot’s out‑of‑the‑box defaults—such as Tomcat’s tiny connection pool, HikariCP’s 10‑thread limit, lazy‑loaded JPA entities, system‑timezone JSON serialization, un‑rolled Logback files, unlimited in‑memory cache, exposed Actuator endpoints, tiny file‑upload limits, per‑task thread creation for @Async, and unlimited transaction timeouts—can silently cripple production systems, so each must be reviewed and tuned for real‑world workloads.

AsyncJacksonLogback
0 likes · 11 min read
Why Ignoring SpringBoot’s Default Settings Guarantees Trouble
Programmer XiaoFu
Programmer XiaoFu
Oct 28, 2025 · Backend Development

6 Ways to Measure API Response Time in Java

This article examines six practical techniques for measuring the latency of online interfaces in Java, from simple System.currentTimeMillis() calls to advanced AOP, interceptors, filters, and production‑grade monitoring tools like Micrometer and APM, comparing their precision, intrusiveness, and suitable scenarios.

AOPJavaMetrics
0 likes · 23 min read
6 Ways to Measure API Response Time in Java