Senior Tony
Author

Senior Tony

Former senior tech manager at Meituan, ex‑tech director at New Oriental, with experience at JD.com and Qunar; specializes in Java interview coaching and regularly shares hardcore technical content. Runs a video channel of the same name.

65
Articles
0
Likes
81
Views
0
Comments
Recent Articles

Latest from Senior Tony

65 recent articles
Senior Tony
Senior Tony
Oct 12, 2024 · Backend Development

When Monolith Meets Microservices: API Composition vs CQRS for Complex Queries

This article compares API composition and CQRS patterns for handling distributed queries in evolving monolithic systems, illustrating their workflows with e‑commerce and online‑education examples, discussing performance trade‑offs, implementation details using Canal and ElasticSearch, and offering practical guidance on when to adopt each approach.

API compositionCQRSCanal
0 likes · 8 min read
When Monolith Meets Microservices: API Composition vs CQRS for Complex Queries
Senior Tony
Senior Tony
Aug 26, 2024 · Backend Development

Should Every Microservice Have Its Own Database? Pros, Cons, and Real‑World Lessons

This article examines the debate over sharing versus isolating databases in microservice architectures, presents arguments from both sides, shares a detailed incident from an online education platform, and outlines best‑practice recommendations for balancing availability, cost, and development efficiency.

Microservicesbackend architecturedatabase isolation
0 likes · 10 min read
Should Every Microservice Have Its Own Database? Pros, Cons, and Real‑World Lessons
Senior Tony
Senior Tony
Aug 13, 2024 · Fundamentals

How to Refactor Course Display Logic with the Decorator Pattern in Java

This article demonstrates how to identify long‑method and duplicated code smells in a Java curriculum‑display service and refactor the implementation using the Decorator pattern, providing clear component diagrams, full code examples, and a runnable demo that showcases flexible extensions for different course types.

Bad SmellDecorator PatternJava
0 likes · 11 min read
How to Refactor Course Display Logic with the Decorator Pattern in Java
Senior Tony
Senior Tony
Jul 20, 2024 · Databases

How MySQL’s Skip Scan Defies the Leftmost Prefix Rule

This article explains MySQL’s composite index leftmost‑prefix rule, demonstrates how the Skip Scan Range Access Method introduced in MySQL 8.0.13 can use indexes without following the rule, provides step‑by‑step examples, code snippets, and discusses its implementation, benefits, and limitations.

Composite IndexMySQLSQL
0 likes · 10 min read
How MySQL’s Skip Scan Defies the Leftmost Prefix Rule
Senior Tony
Senior Tony
Jul 15, 2024 · Databases

Mastering Redis maxmemory‑policy: How LRU, LFU and Other Eviction Strategies Work

This article explains how Redis handles memory exhaustion by configuring maxmemory and maxmemory-policy, detailing each eviction strategy (noeviction, volatile‑lru, volatile‑lfu, volatile‑ttl, volatile‑random, allkeys‑lru, allkeys‑lfu, allkeys‑random), their implementation details, and the underlying approximate LRU algorithm.

LFULRURedis
0 likes · 8 min read
Mastering Redis maxmemory‑policy: How LRU, LFU and Other Eviction Strategies Work
Senior Tony
Senior Tony
Jul 10, 2024 · Databases

When to Use MySQL Hash Join vs. Nested Loop: A Practical Guide

This article explains MySQL's hash join algorithm, compares it with nested‑loop joins, shows how to read execution steps and EXPLAIN output, discusses extended hash‑join scenarios, and weighs the trade‑offs of performing multi‑table joins inside the database versus in application code.

Hash JoinJoin AlgorithmsMySQL
0 likes · 8 min read
When to Use MySQL Hash Join vs. Nested Loop: A Practical Guide
Senior Tony
Senior Tony
Jul 4, 2024 · Databases

Why MySQL Joins Aren’t Always Slow: Inside the Four Join Algorithms

This article uses a realistic interview scenario to explore why multi-table joins in MySQL are not inherently slow, detailing four join algorithms—simple nested-loop, index nested-loop, block nested-loop, and batched key access—along with their pseudo‑code, execution steps, performance trade‑offs, and the impact of features like MRR and recent optimizer changes.

Index JoinJoin AlgorithmsMySQL
0 likes · 10 min read
Why MySQL Joins Aren’t Always Slow: Inside the Four Join Algorithms
Senior Tony
Senior Tony
Feb 22, 2024 · Backend Development

Eight Distributed ID Generation Strategies: Pros, Cons, and Implementation Guide

This article reviews eight popular distributed ID generation methods—including UUID, database auto‑increment, Redis INCR, Snowflake, database segment, Meituan Leaf, Didi Tinyid, and Baidu UidGenerator—detailing their principles, code examples, advantages, disadvantages, and practical considerations for choosing the right solution.

Distributed IDLeafRedis
0 likes · 11 min read
Eight Distributed ID Generation Strategies: Pros, Cons, and Implementation Guide