Code Farming
Author

Code Farming

Senior engineer at a top internet giant, sharing Java, AI, tech knowledge, growth insights, and interview experiences.

24
Articles
0
Likes
15
Views
0
Comments
Recent Articles

Latest from Code Farming

24 recent articles
Code Farming
Code Farming
Aug 5, 2026 · Backend Development

How to Generate Billions of Conflict‑Free Short URLs

The article breaks down a real‑world architecture for a short‑URL service that must handle 12 billion entries and 40 k QPS, showing how to calculate capacity, compare generation algorithms, use Bloom filters for offline de‑duplication, and employ a three‑layer cache‑plus‑storage design to meet performance goals.

Bloom filterHBaseHigh Concurrency
0 likes · 7 min read
How to Generate Billions of Conflict‑Free Short URLs
Code Farming
Code Farming
Aug 4, 2026 · Backend Development

Why 50,000 Simultaneous Registrations Crashed the System—and How Isolation Prevents It

When an education company faced 50,000 concurrent re‑registration requests, its monolithic internal‑external architecture collapsed, but by physically separating networks, enforcing gateway rate‑limiting and circuit‑breaking, pre‑loading data into Redis, and using one‑way Kafka streams, the system remained stable.

High ConcurrencyKafkaRedis
0 likes · 6 min read
Why 50,000 Simultaneous Registrations Crashed the System—and How Isolation Prevents It
Code Farming
Code Farming
Jul 31, 2026 · Backend Development

How the Right API Gateway Can Halve Development Costs

By consolidating authentication, caching, and fault‑tolerance logic into a properly chosen API gateway, teams can eliminate duplicated SDK changes, cut backend QPS dramatically, and turn costly release windows into seamless upgrades, effectively reducing development effort by up to 50%.

API GatewayAuthenticationCaching
0 likes · 6 min read
How the Right API Gateway Can Halve Development Costs
Code Farming
Code Farming
Jul 30, 2026 · Backend Development

Can Your System Survive a Sudden 500K Live Viewers? 4 Proven Traffic‑Splitting Techniques

When a live broadcast suddenly attracts 500,000 viewers, the system faces 100,000 QPS likes and rapid reward transactions; this article breaks down a battle‑tested traffic‑splitting architecture—room‑based sharding, queue buffering, multi‑layer write caching, and consistent‑hash sharding—showing how each component controls load, ensures consistency, and enables seamless scaling.

High Concurrencyconsistent hashingdistributed cache
0 likes · 6 min read
Can Your System Survive a Sudden 500K Live Viewers? 4 Proven Traffic‑Splitting Techniques
Code Farming
Code Farming
Jul 29, 2026 · Backend Development

Billions of Logs in Seconds: How Elasticsearch Makes It Possible

The article explains how Elasticsearch achieves sub‑second search over billions of log entries by combining sharding, immutable segment writes, a three‑layer inverted index, and a two‑phase query‑then‑fetch process that distributes work across nodes.

ElasticsearchShardingdistributed search
0 likes · 6 min read
Billions of Logs in Seconds: How Elasticsearch Makes It Possible
Code Farming
Code Farming
Jul 26, 2026 · Backend Development

How Is a Red Envelope System Designed for High‑Concurrency?

This article breaks down the end‑to‑end design of a high‑traffic red‑envelope service, covering its three‑stage lifecycle, a fair double‑mean allocation algorithm, the need to separate grabbing from settlement, and how Redis, Lua scripts, and message queues handle massive concurrent requests.

Message QueueRedisbackend
0 likes · 7 min read
How Is a Red Envelope System Designed for High‑Concurrency?
Code Farming
Code Farming
Jul 23, 2026 · Backend Development

Cut Authentication Traffic 50‑Fold with JWT: A Simple Token Strategy

The article explains how replacing centralized session lookups with JWT-based local verification can cut authentication latency from 15 ms to 0.3 ms—a roughly 50‑fold improvement—while describing a double‑token strategy, its refresh flow, security best practices, and trade‑offs such as delayed revocation.

Access TokenJWTPerformance
0 likes · 6 min read
Cut Authentication Traffic 50‑Fold with JWT: A Simple Token Strategy
Code Farming
Code Farming
Jul 22, 2026 · Backend Development

Designing a 5‑Layer Flash‑Sale System to Handle Millions of Requests

To survive a million concurrent flash‑sale clicks, the article breaks down a production‑grade, five‑layer architecture—CDN, load balancer, API gateway, Redis/Lua stock control, message‑queue order processing, and a state‑machine fallback—that filters traffic early, uses atomic operations, and decouples writes to keep database load to just a few QPS.

Flash SaleMessage QueueMySQL
0 likes · 7 min read
Designing a 5‑Layer Flash‑Sale System to Handle Millions of Requests
Code Farming
Code Farming
Jul 20, 2026 · Backend Development

How a Message Queue Keeps Flash‑Sale Systems Stable Under 10k Orders per Second

The article explains how using a message queue as a buffer, asynchronous processor, and decoupling layer enables flash‑sale systems to handle tens of thousands of orders per second, reducing database overload, cutting response time from 500 ms to 50 ms, and preventing cascade failures.

Flash SaleHigh ConcurrencyMessage Queue
0 likes · 5 min read
How a Message Queue Keeps Flash‑Sale Systems Stable Under 10k Orders per Second
Code Farming
Code Farming
Jul 13, 2026 · Backend Development

Mastering Traffic Control: Keeping Systems Stable Under a Million Concurrent Requests

The article explains how to prevent system crashes during massive traffic spikes by applying three core techniques—rate limiting, circuit breaking, and graceful degradation—detailing algorithm choices, state machines, and practical implementation steps for high‑concurrency back‑end services.

High Concurrencybackendcircuit breaker
0 likes · 6 min read
Mastering Traffic Control: Keeping Systems Stable Under a Million Concurrent Requests