Shepherd Advanced Notes
Author

Shepherd Advanced Notes

Dedicated to sharing advanced Java technical insights, daily work snippets, and the power of persistent effort.

123
Articles
0
Likes
167
Views
0
Comments
Recent Articles

Latest from Shepherd Advanced Notes

100 recent articles max
Shepherd Advanced Notes
Shepherd Advanced Notes
Sep 29, 2023 · Backend Development

How to Cut API Latency from 5 s to 0.5 s with CompletableFuture Async Optimizations

The article explains how to dramatically reduce the response time of an API that must call multiple downstream services by converting serial calls into parallel ones using Java 8's CompletableFuture, covering its relationship to Future, core APIs, task composition, exception handling, and practical best‑practice recommendations.

Asynchronous ProgrammingCompletableFutureException Handling
0 likes · 20 min read
How to Cut API Latency from 5 s to 0.5 s with CompletableFuture Async Optimizations
Shepherd Advanced Notes
Shepherd Advanced Notes
Sep 19, 2023 · Backend Development

How Douyin Implements IP Geolocation: A Java Backend Tutorial

This article explains how to retrieve a client’s real IP behind proxies, choose the appropriate forwarding header, and use the open‑source ip2region library to map the IP to a geographic location, with complete Java and Spring Boot code examples.

HttpServletRequestIP GeolocationJava
0 likes · 17 min read
How Douyin Implements IP Geolocation: A Java Backend Tutorial
Shepherd Advanced Notes
Shepherd Advanced Notes
Sep 15, 2023 · Backend Development

How to Prevent Duplicate Order Submissions in Flash‑Sale Systems: An Idempotency Guide

The article explains the concept of idempotency, outlines common duplicate‑submission scenarios such as form resubmission, malicious voting, client retries, and message re‑consumption, and details three practical implementation methods—database constraints, token‑based middleware, and state‑machine logic—complete with code examples and trade‑off considerations.

Databasebackend developmentduplicate order
0 likes · 13 min read
How to Prevent Duplicate Order Submissions in Flash‑Sale Systems: An Idempotency Guide
Shepherd Advanced Notes
Shepherd Advanced Notes
Sep 1, 2023 · Big Data

Visual Guide to Kafka’s Architecture and Core Principles

This article explains Kafka’s architecture in depth, covering components such as producers, consumers, topics, partitions, replication, Zookeeper coordination, the Controller’s election and responsibilities, state machines, and the NIO‑based network model, using clear diagrams and analogies.

ControllerKafkaNetwork Model
0 likes · 14 min read
Visual Guide to Kafka’s Architecture and Core Principles
Shepherd Advanced Notes
Shepherd Advanced Notes
Aug 30, 2023 · Databases

Achieving Efficient Real‑Time Search for Massive Data in Spring Boot Applications

The article analyzes why massive tables become a bottleneck in Spring Boot systems, outlines the drawbacks of sharding, and presents a layered solution—data archiving, read‑write separation with caching, heterogeneous source synchronization via Elasticsearch and Canal, and selective sharding—to enable high‑performance real‑time search.

CanalData ArchivingElasticsearch
0 likes · 13 min read
Achieving Efficient Real‑Time Search for Massive Data in Spring Boot Applications
Shepherd Advanced Notes
Shepherd Advanced Notes
Aug 21, 2023 · Backend Development

High‑Availability Rate‑Limiting Solutions for Spring Boot Systems

The article explains why rate limiting is essential for high‑traffic Spring Boot services, compares counter, sliding‑window, token‑bucket and leaky‑bucket algorithms, demonstrates implementations with plain Java, Guava RateLimiter, AOP, and distributed approaches using Redis‑Lua and Nginx‑Lua, and provides practical configuration examples.

GuavaNginxSliding Window
0 likes · 20 min read
High‑Availability Rate‑Limiting Solutions for Spring Boot Systems
Shepherd Advanced Notes
Shepherd Advanced Notes
Aug 14, 2023 · Backend Development

Common @Transactional Pitfalls in Spring Boot Business Code and How to Avoid Them

This article analyzes frequent scenarios where Spring's @Transactional annotation fails in Spring Boot projects—such as self-invocation, swallowed exceptions, misconfigured rollback rules, non‑public methods, wrong propagation settings, and long‑running transactions—and provides concrete fixes to prevent data inconsistency and performance issues.

CGLIB proxyTransaction ManagementTransactional
0 likes · 17 min read
Common @Transactional Pitfalls in Spring Boot Business Code and How to Avoid Them
Shepherd Advanced Notes
Shepherd Advanced Notes
Aug 7, 2023 · Backend Development

Implementing Multilevel Cache in Spring Boot with Redis and Caffeine

This article explains how to build a three‑layer cache architecture for Spring Boot by integrating Redis as a distributed cache with Caffeine as a local cache, covering configuration, custom CacheManager implementation, message‑driven synchronization, and practical usage examples.

CaffeineSpring Cachecache
0 likes · 15 min read
Implementing Multilevel Cache in Spring Boot with Redis and Caffeine
Shepherd Advanced Notes
Shepherd Advanced Notes
Jul 31, 2023 · Backend Development

How Spring Uses AOP to Implement Transaction Management

This article explains why transaction control is essential for database‑backed applications, compares native JDBC/MyBatis handling with Spring's unified approach, details the core transaction APIs, and walks through the AOP‑based mechanism—including @EnableTransactionManagement, proxy generation, and CGLIB interception—that automatically opens, commits, and rolls back transactions at runtime.

AOPCGLIBPlatformTransactionManager
0 likes · 20 min read
How Spring Uses AOP to Implement Transaction Management