Databases 8 min read

Principles and Practices of MySQL Database Sharding

The article explains when MySQL sharding is needed, outlines five practical principles for deciding to split databases or tables, provides real‑world examples, and shares operational tips for implementing horizontal partitioning to improve performance, availability, and manageability.

Qunar Tech Salon
Qunar Tech Salon
Qunar Tech Salon
Principles and Practices of MySQL Database Sharding

Zhou Yanwei, the Database Director at Qunar.com and chair of the China MySQL User Group, manages MySQL, Redis, and HBase platforms, designing architectures, tuning performance, and building automation tools such as the Qunar MySQL development standards, backup platform, and high‑availability designs.

He discusses why MySQL eventually requires sharding (splitting databases or tables) as data volume grows, noting that internal lock granularity limits QPS and that users often wait for vendor optimizations.

Principle 0: Avoid sharding if possible; first try hardware upgrades, read/write separation, and load balancing.

Principle 1: When data size hampers normal operations, such as backup I/O overload or long DDL locks, splitting reduces risk and downtime.

Principle 2: Vertically split tables with poorly designed schemas, isolating large or frequently accessed columns (e.g., user login timestamps or large text fields) to improve performance.

Principle 3: Horizontally split tables that experience unbounded growth (e.g., comments, logs, feeds) by partitioning on user, time, or purpose.

Principle 4: Improve availability by distributing data across multiple instances, preventing a single point of failure.

Principle 5: Reduce business coupling; isolate unrelated services (e.g., ticketing vs. food ordering) to avoid one service’s issues affecting another.

The article concludes with a reminder that sharding decisions are dynamic, often requiring merging later, and invites further discussion.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Operationsshardingmysqldatabase scalingPartitioning
Qunar Tech Salon
Written by

Qunar Tech Salon

Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.

0 followers
Reader feedback

How this landed with the community

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.