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
Nov 22, 2024 · Backend Development

15 Must-Know SpringBoot Startup Extension Points – Which Have You Used?

This article enumerates fifteen common SpringBoot startup extension points, explains their positions in the bean lifecycle, illustrates each with concrete code snippets and usage scenarios, and provides a visual call‑order diagram to help developers harness these hooks for custom initialization and middleware development.

BackendBeanLifecycleExtensionPoints
0 likes · 18 min read
15 Must-Know SpringBoot Startup Extension Points – Which Have You Used?
Programmer XiaoFu
Programmer XiaoFu
Nov 19, 2024 · Backend Development

When Stream Makes Your Java Code Look Ugly: Pitfalls and Clean‑up Tips

The article examines how Java Stream and Lambda, while designed for concise and expressive code, often become sources of unreadable and hard‑to‑maintain implementations, and it offers concrete refactoring techniques, proper use of Optional, and cautions about ParallelStream performance.

Code styleOptionalStream API
0 likes · 8 min read
When Stream Makes Your Java Code Look Ugly: Pitfalls and Clean‑up Tips
Programmer XiaoFu
Programmer XiaoFu
Nov 16, 2024 · Backend Development

How Leading Companies Implement Distributed Caching – Lessons and Pitfalls

The article examines the benefits and hidden risks of using distributed caches, analyzes real‑world failure cases from Facebook, Google and AWS, and provides detailed strategies to mitigate availability and consistency problems through careful refresh policies, incremental updates, and compensation mechanisms.

Cache consistencyavailability riskcache design
0 likes · 19 min read
How Leading Companies Implement Distributed Caching – Lessons and Pitfalls
Programmer XiaoFu
Programmer XiaoFu
Nov 14, 2024 · Backend Development

Designing Elegant API Controllers: Security, Idempotency, and Best Practices

This guide walks through building robust API controller interfaces by covering request signing, RSA encryption, IP whitelisting, rate limiting, parameter validation, unified response formats, exception handling, logging, idempotent design, request size limits, stress testing, asynchronous processing, data masking, and comprehensive documentation.

API DesignBackendIdempotency
0 likes · 15 min read
Designing Elegant API Controllers: Security, Idempotency, and Best Practices
Programmer XiaoFu
Programmer XiaoFu
Nov 4, 2024 · Backend Development

How to Build an Unbeatable Weekly Hot‑Comment Ranking with Redis

The article shows how to avoid database pressure by recording daily comment counts in Redis sorted sets, merging the seven daily sets into a weekly ranking with a union command, and exposing the result through a Spring Boot service and a custom Freemarker tag, complete with code examples and screenshots.

RedisSorted SetSpring Boot
0 likes · 17 min read
How to Build an Unbeatable Weekly Hot‑Comment Ranking with Redis
Programmer XiaoFu
Programmer XiaoFu
Oct 30, 2024 · Databases

How to Boost Pagination Queries for a Million Products by 10×

This article walks through nine practical techniques—default filters, smaller page sizes, fewer joins, index tuning, straight_join, data archiving, efficient count(*), ClickHouse offloading, and read/write splitting—to dramatically improve the performance of pagination APIs handling millions of product records.

ClickHouseMySQLSQL
0 likes · 11 min read
How to Boost Pagination Queries for a Million Products by 10×
Programmer XiaoFu
Programmer XiaoFu
Oct 25, 2024 · Databases

Why Is My Redis Slowing Down in Production and How to Diagnose It

The article explains how to detect and troubleshoot Redis latency spikes by measuring baseline performance, using slowlog and latency‑monitor, checking network RTT, fork‑induced pauses, huge pages, swap usage, AOF settings, expiration handling, and big‑key problems, providing concrete commands and mitigation steps.

AOFBigKeyPipeline
0 likes · 19 min read
Why Is My Redis Slowing Down in Production and How to Diagnose It
Programmer XiaoFu
Programmer XiaoFu
Oct 22, 2024 · Databases

What Batch Size Gives MySQL the Best Insert Performance?

This article explains how MySQL writes data to cache before flushing to disk, compares single‑row versus batch inserts, discusses how hardware limits, transaction size, and lock contention affect performance, and shows how to estimate an optimal batch size with concrete calculations and MyBatis examples.

Batch InsertMemoryMySQL
0 likes · 14 min read
What Batch Size Gives MySQL the Best Insert Performance?
Programmer XiaoFu
Programmer XiaoFu
Oct 21, 2024 · Databases

Understanding the Differences Between Redis Bitmap and Bloom Filter

This article explains how Redis Bitmap stores binary states using bit arrays, details its commands and use cases, then introduces Bloom Filter's probabilistic set membership, compares their advantages, limitations, and typical scenarios such as cache penetration protection and blacklist filtering.

BitMapBloom FilterCache
0 likes · 12 min read
Understanding the Differences Between Redis Bitmap and Bloom Filter