Skip to content
Code Farming
Author

Code Farming

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

41
Articles
0
Likes
250
Views
0
Comments
Recent Articles

Latest from Code Farming

41 recent articles
Code Farming
Code Farming
Jul 2, 2026 · Backend Development

Five Fatal Cache Pitfalls Explained with Five Diagrams

The article outlines five common cache design problems—penetration, concurrency, avalanche, hot‑data management, and business‑cache coupling—illustrates each with a diagram, and provides concrete Redis‑based solutions such as placeholder values, setNX locks, random TTLs, sorted‑set queues, and a Binlog‑Canal‑MQ pipeline.

CacheCache ConcurrencyCache Decoupling
0 likes · 7 min read
Five Fatal Cache Pitfalls Explained with Five Diagrams
Code Farming
Code Farming
Jul 1, 2026 · Databases

Redis Core Principles Explained with Four Diagrams

This article breaks down Redis’s core mechanisms—including its single‑threaded performance tricks, AOF and RDB persistence designs, and the evolution of high‑availability from replication to Sentinel and Cluster—using four clear diagrams to help readers master the system.

AOFClusterHigh Availability
0 likes · 6 min read
Redis Core Principles Explained with Four Diagrams
Code Farming
Code Farming
Jun 24, 2026 · Databases

MySQL Indexes: Master B+Tree Fundamentals to Nail Interview Questions

The article breaks down MySQL index mechanics into four visual sections, explaining B+Tree structure, why it outperforms B‑tree, hash and binary trees, common index‑failure scenarios, and three practical optimization techniques, giving interviewees a clear framework to answer index‑related questions confidently.

B+TreeDatabase PerformanceIndex Optimization
0 likes · 7 min read
MySQL Indexes: Master B+Tree Fundamentals to Nail Interview Questions
Code Farming
Code Farming
Jun 22, 2026 · Backend Development

Why Your Distributed Lock Keeps Failing in Production (And How to Fix It)

This article explains the three fundamental challenges of distributed locks—availability, deadlock, and split‑brain—compares database and Redis implementations, walks through the five evolutionary steps of Redis locking, and provides a structured interview answer framework to demonstrate deep understanding.

Distributed LockInterview PreparationMySQL
0 likes · 8 min read
Why Your Distributed Lock Keeps Failing in Production (And How to Fix It)
Code Farming
Code Farming
Jun 20, 2026 · Backend Development

How This Architecture Handles Tens‑Fold Traffic Spikes Without Crashing

The article breaks down a complete flash‑sale system into four phases and explains how Redis distributed locks, CDN static pages, Nginx rate limiting, message‑queue peak shaving, and sharding together prevent overselling, crashes, and lost orders even when traffic surges dozens of times.

High ConcurrencyMessage QueueNginx
0 likes · 6 min read
How This Architecture Handles Tens‑Fold Traffic Spikes Without Crashing
Code Farming
Code Farming
Jun 19, 2026 · Backend Development

Nail Distributed Transaction Consistency Questions in Interviews with This Full‑Score Answer

The article explains why reciting the 2PC protocol fails in real‑world interviews, then walks through the two dominant solutions—two‑phase commit and MQ‑based eventual consistency—detailing their mechanisms, trade‑offs, and a concrete interview response template that showcases practical experience and theoretical depth.

Distributed TransactionsInterview PreparationMessage Queue
0 likes · 6 min read
Nail Distributed Transaction Consistency Questions in Interviews with This Full‑Score Answer
Code Farming
Code Farming
Jun 18, 2026 · Backend Development

How to Build a Billion‑Item Distributed Store: From Modulo Hash to Raft

The article walks through five interview‑style steps—modulo hashing, consistent hashing, range sharding, metadata routing with etcd, and choosing Raft or Gossip—to design a highly scalable, hot‑item‑aware, and consistent distributed storage system for billions of products.

Consistent HashingGossipRaft
0 likes · 7 min read
How to Build a Billion‑Item Distributed Store: From Modulo Hash to Raft
Code Farming
Code Farming
Sep 16, 2024 · Backend Development

Understanding Elasticsearch’s Document Retrieval Process

The article walks through Elasticsearch’s document retrieval workflow, covering single‑document GET, multi‑document mget, the two‑stage query_then_fetch mechanism, shard routing, load balancing, query and fetch phases, collectors, rescore, and pagination optimizations.

ElasticsearchQuery_then_fetchSearch Architecture
0 likes · 19 min read
Understanding Elasticsearch’s Document Retrieval Process
Code Farming
Code Farming
Sep 15, 2024 · Backend Development

How Elasticsearch Indexes Documents: Step‑by‑Step Process

This article walks through Elasticsearch’s document indexing pipeline—from single‑document and bulk request routing, through the write‑refresh‑flush‑merge cycle, to the roles of Lucene, the translog, primary and replica shards, and how reliability, consistency, atomicity, isolation, real‑time visibility and performance are achieved.

Elasticsearchdocument indexingflush
0 likes · 22 min read
How Elasticsearch Indexes Documents: Step‑by‑Step Process
Code Farming
Code Farming
Sep 15, 2024 · Backend Development

Understanding Elasticsearch: Core Principles and Architecture

This article explains Elasticsearch’s overall structure, the underlying Lucene index layout, the indexing and search processing flow, and how built‑in analyzers work, illustrating each concept with diagrams, token examples, and query scenarios.

AnalyzersElasticsearchIndexing
0 likes · 10 min read
Understanding Elasticsearch: Core Principles and Architecture