Programmer XiaoFu
Author

Programmer XiaoFu

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

108
Articles
0
Likes
140
Views
0
Comments
Recent Articles

Latest from Programmer XiaoFu

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

RedisSpring BootWeekly Ranking
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.

ClickHouseIndex OptimizationMySQL
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.

BigKeyPipelineRedis
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 InsertDisk I/OMyBatis
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
Programmer XiaoFu
Programmer XiaoFu
Oct 18, 2024 · Backend Development

Unlock Spring Boot’s Powerful Built‑In Features You’re Not Using

This article walks through Spring Boot’s built‑in utilities—including request logging with CommonsRequestLoggingFilter, request/response wrappers, the OncePerRequestFilter base class, and AOP helpers like AopContext, AopUtils, and ReflectionUtils—showing how to configure and apply them in real code.

AOPContentCachingWrapperOncePerRequestFilter
0 likes · 12 min read
Unlock Spring Boot’s Powerful Built‑In Features You’re Not Using
Programmer XiaoFu
Programmer XiaoFu
Oct 14, 2024 · Backend Development

How to Use Spring’s Three Asynchronous Streaming APIs to Eliminate Timeout Issues

This article explains how Spring’s ResponseBodyEmitter, SseEmitter, and StreamingResponseBody can be used to build asynchronous streaming endpoints that continuously push data to clients, avoid servlet thread blocking, and prevent request‑timeout problems, with complete code examples and usage guidelines.

AsynchronousJavaResponseBodyEmitter
0 likes · 9 min read
How to Use Spring’s Three Asynchronous Streaming APIs to Eliminate Timeout Issues
Programmer XiaoFu
Programmer XiaoFu
Oct 12, 2024 · Fundamentals

How Generics + Functional Programming Make Java Code Look More Sophisticated

The article demonstrates how combining Java generics with functional programming—using lambda‑based callbacks and generic pagination utilities—can transform repetitive data‑access code into a concise, reusable structure, while also discussing the benefits, trade‑offs, and potential debugging challenges of this approach.

AsyncGenericsJava
0 likes · 11 min read
How Generics + Functional Programming Make Java Code Look More Sophisticated