Programmer XiaoFu
Author

Programmer XiaoFu

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

111
Articles
0
Likes
419
Views
0
Comments
Recent Articles

Latest from Programmer XiaoFu

100 recent articles max
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.

GrafanaJavaMonitoring
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.

@TransactionalAOPJava
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 SQLJavaXML Mapping
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.

ConcurrentModificationExceptionHashMapIterator
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 IdempotencyKafka
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 performanceDistributed LockMonitoring
0 likes · 27 min read
11 Proven Techniques to Boost API Performance by 100×
Programmer XiaoFu
Programmer XiaoFu
Jul 10, 2024 · Backend Development

Why You Should Avoid Collectors.toMap in Java Streams

The article shows how using Collectors.toMap can trigger IllegalStateException for duplicate keys and NullPointerException for null values, and demonstrates proper merge functions, Optional handling, and a plain‑for‑loop alternative to safely convert a List of objects into a Map.

Collectors.toMapDuplicateKeysHashMap
0 likes · 5 min read
Why You Should Avoid Collectors.toMap in Java Streams
Programmer XiaoFu
Programmer XiaoFu
Jul 3, 2024 · Backend Development

Fast Large‑File Chunked Upload with Spring Boot and MinIO

This article walks through setting up MinIO, installing it via Docker on CentOS 7, configuring Spring Boot, and implementing chunked, instant‑resume, and resumable uploads for large files, complete with code examples, Docker commands, and troubleshooting tips.

JavaMinIOObject Storage
0 likes · 25 min read
Fast Large‑File Chunked Upload with Spring Boot and MinIO
Programmer XiaoFu
Programmer XiaoFu
Jun 27, 2024 · Backend Development

Choosing a Service Registry: In‑Depth Comparison of Zookeeper, Eureka, Nacos, Consul, and Etcd

This article explains the fundamental concepts of service registries, examines CAP theory and consensus protocols, and provides a detailed analysis of Zookeeper, Eureka, Nacos, Consul, and Etcd—including their architectures, features, trade‑offs, and practical guidance for selecting the most suitable registry for a given environment.

ConsulEurekaNacos
0 likes · 23 min read
Choosing a Service Registry: In‑Depth Comparison of Zookeeper, Eureka, Nacos, Consul, and Etcd