Backend Development 14 min read

Scaling a Personal Blog: Caching, Load Balancing, Read/Write Splitting, Sharding, and NewSQL

This article explains how to transform a simple personal‑blog backend into a high‑performance, horizontally scalable system by introducing caching with Redis, load balancing with Nginx/LVS, read/write separation, database sharding, and modern NewSQL solutions such as TiDB, while also discussing related challenges like cache consistency and data migration.

Top Architect
Top Architect
Top Architect
Scaling a Personal Blog: Caching, Load Balancing, Read/Write Splitting, Sharding, and NewSQL

Many developers start with a basic personal‑blog backend consisting of a single cloud server running MySQL and a Node.js HTTP server, which works fine for low traffic but quickly fails under heavy load.

To handle increasing read traffic, the article recommends adding a Redis cache (a key‑value in‑memory store) to serve hot data, reducing database load, and warns about cache consistency, penetration, and avalanche issues.

When a single server can no longer handle the request volume, horizontal scaling is suggested: deploy multiple business servers behind a reverse‑proxy (Nginx) and use load‑balancing algorithms to distribute traffic, ensuring stateless server design for easy scaling.

For high availability, the article introduces Linux Virtual Server (LVS) with keepalived to provide virtual IP failover, and mentions DNS‑based load balancing as an additional layer.

Database bottlenecks are addressed through read/write separation (master‑slave replication) and sharding (splitting data across multiple master nodes). It discusses routing strategies, hash‑based and consistent‑hash approaches, and the need for middleware like MyCat to handle cross‑shard queries and maintain ACID properties.

The limitations of traditional MySQL storage (write amplification) lead to a discussion of NewSQL and LSM‑Tree based databases (RocksDB, LevelDB). TiDB, built on RocksDB with Multi‑Raft, is presented as a distributed alternative that simplifies sharding and replication.

Finally, the article summarizes the progression from single‑server architecture to a distributed system using caching, horizontal scaling, read/write separation, sharding, and NewSQL, emphasizing that these techniques together provide high throughput, consistency, and scalability for modern web services.

distributed systemsShardingload balancingRedisCachingMySQLRead-Write SplittingNewSQL
Top Architect
Written by

Top Architect

Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.