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
Sep 19, 2024 · Backend Development

Six Practical Rate‑Limiting Techniques for Microservices

The article walks through six concrete rate‑limiting methods—fixed window, sliding window, leaky bucket, token bucket (Guava RateLimiter), Sentinel middleware, and Spring Cloud Gateway—showing Java implementations, test results, advantages, drawbacks, and how they fit into microservice architectures.

GuavaJavaSentinel
0 likes · 20 min read
Six Practical Rate‑Limiting Techniques for Microservices
Programmer XiaoFu
Programmer XiaoFu
Sep 12, 2024 · Backend Development

How Major Companies Implement Distributed Tracing with TraceIdFilter, MDC, and SkyWalking

The article explains how to solve interleaved multi‑thread logs in micro‑services by adding a X‑App‑Trace‑Id header, extracting it in a TraceIdFilter, storing it in SLF4J MDC, propagating it through Feign, adapting it for child threads, and finally integrating SkyWalking to print both application and SkyWalking trace IDs in Logback.

Distributed TracingLogbackMDC
0 likes · 16 min read
How Major Companies Implement Distributed Tracing with TraceIdFilter, MDC, and SkyWalking
Programmer XiaoFu
Programmer XiaoFu
Sep 9, 2024 · Backend Development

Mastering Alibaba Sentinel: Flow Control, Degradation, and Cluster Management Guide

This comprehensive tutorial walks through Alibaba Sentinel's core concepts, installation, dashboard setup, microservice integration, flow‑control configurations, degradation strategies, hotspot parameter limiting, system‑adaptive rules, custom block handlers, whitelist/blacklist policies, rule persistence with Nacos, and cluster flow control for resilient Java backend services.

JavaNacosSentinel
0 likes · 38 min read
Mastering Alibaba Sentinel: Flow Control, Degradation, and Cluster Management Guide
Programmer XiaoFu
Programmer XiaoFu
Sep 2, 2024 · Backend Development

Designing a Dynamic Thread Pool for a Meituan Interview: Concepts and Implementation

The article explains what a dynamic thread pool is, why static pools are problematic, how to modify core parameters such as corePoolSize, maximumPoolSize, and workQueue at runtime, and provides code examples for monitoring, exposing metrics via Spring Boot Actuator, and integrating with Prometheus‑Grafana, while also listing open‑source implementations like Hippo4j and Dynamic TP.

Dynamic Thread PoolGrafanaJava
0 likes · 13 min read
Designing a Dynamic Thread Pool for a Meituan Interview: Concepts and Implementation
Programmer XiaoFu
Programmer XiaoFu
Aug 29, 2024 · Backend Development

Why @Transactional Often Fails: 13 Real‑World Pitfalls from 6 Years of Experience

This article analyses thirteen common mistakes that cause Spring's @Transactional annotation to be ineffective or not roll back, covering unnecessary usage, private/final/static methods, self‑invocation, wrong propagation settings, async threads, unmanaged beans, exception handling and more, with concrete code demos and solutions.

AOPException HandlingJava
0 likes · 21 min read
Why @Transactional Often Fails: 13 Real‑World Pitfalls from 6 Years of Experience
Programmer XiaoFu
Programmer XiaoFu
Aug 28, 2024 · Backend Development

10 Powerful MyBatis SQL Patterns Used by Top Companies

This article presents ten practical MyBatis dynamic‑SQL techniques—including foreach, if, choose, selectKey, trim, and sql fragments—explaining their attributes, common pitfalls, and providing complete Java mapper and XML examples that help reduce boilerplate and avoid errors.

Dynamic SQLJavaMyBatis
0 likes · 21 min read
10 Powerful MyBatis SQL Patterns Used by Top Companies
Programmer XiaoFu
Programmer XiaoFu
Aug 8, 2024 · Databases

Why Is MySQL Slow? Beyond Index Issues and Practical Fixes

The article walks through MySQL’s query execution flow, shows how to profile slow statements, explains index‑related pitfalls, connection‑pool limits, and InnoDB buffer‑pool sizing, and provides concrete commands and examples to diagnose and speed up sluggish queries.

Connection PoolEXPLAINInnoDB Buffer Pool
0 likes · 15 min read
Why Is MySQL Slow? Beyond Index Issues and Practical Fixes
Programmer XiaoFu
Programmer XiaoFu
Jul 30, 2024 · Fundamentals

Why Deleting or Adding Entries During a HashMap foreach Loop Triggers ConcurrentModificationException

The article explains why modifying a HashMap—by removing, adding, or putting entries—while iterating with a Java foreach loop causes a ConcurrentModificationException, demonstrates the underlying bytecode transformation, and shows how to safely perform such operations using an Iterator.

CollectionsConcurrentModificationExceptionHashMap
0 likes · 12 min read
Why Deleting or Adding Entries During a HashMap foreach Loop Triggers ConcurrentModificationException
Programmer XiaoFu
Programmer XiaoFu
Jul 24, 2024 · Backend Development

Root‑Cause Solutions for Kafka Message Duplicates

The article analyzes why Kafka messages are duplicated on both producer and consumer sides, explains at‑most‑once, at‑least‑once, and exactly‑once delivery semantics, and walks through three concrete remedies—idempotent producers, transactions, and consumer‑side deduplication—backed by configuration details, code samples, and practical deployment steps.

ConfigurationConsumer IdempotencyIdempotent Producer
0 likes · 12 min read
Root‑Cause Solutions for Kafka Message Duplicates
Programmer XiaoFu
Programmer XiaoFu
Jul 18, 2024 · Backend Development

11 Proven Techniques to Boost API Performance by 100×

This article walks through eleven practical methods—such as adding proper indexes, optimizing SQL, parallelizing remote calls, eliminating duplicate queries, using async processing, shrinking transaction scope, refining lock granularity, applying pagination, leveraging caching layers, and employing sharding and monitoring tools—to dramatically improve backend interface performance.

API performanceSQL tuningSharding
0 likes · 27 min read
11 Proven Techniques to Boost API Performance by 100×