Why Single-Node MySQL Fails and Distributed Databases Are the Future
Even non-programmers notice MySQL’s growing pains—large tables, oversized databases, and read-heavy workloads—prompting a shift toward distributed databases, where sharding, read/write separation, and cloud-native solutions like TiDB or Aurora replace traditional middleware, marking the end of single-node MySQL dominance.
Limitations of a single‑node MySQL deployment
When a single table grows beyond a few million rows (e.g., >5 000 000), query latency increases sharply because the storage engine must scan larger data sets.
A single database instance consumes all CPU, memory and I/O resources, leaving little headroom for additional services.
High read traffic competes with write operations, causing write amplification and reduced throughput.
Common architectural responses
AOP / interceptor layer – Wrap MyBatis, JPA or other ORM frameworks with Aspect‑Oriented Programming to route SQL statements. This is the quickest way to prototype sharding but tightly couples business code to the sharding logic.
JDBC driver proxy – Implement a custom DataSource, Connection, Statement and ResultSet that keep routing tables in memory. The approach is non‑intrusive to application code but still requires manual creation of physical tables for each logical shard and is limited to the Java ecosystem.
MySQL protocol proxy – Deploy a server that pretends to be a MySQL instance, intercepts client packets and forwards them to the appropriate backend databases. This adds an extra service to operate and typically offers a reduced feature set compared with native databases.
Open‑source sharding middleware – Projects such as TDDL, Cobar, MyCat and especially Apache ShardingSphere provide a ready‑made routing layer, SQL rewrite capabilities and integration with popular ORMs. ShardingSphere has become the de‑facto standard in recent years.
Operational trade‑offs of middleware
Physical table management remains the responsibility of DBA teams; the middleware does not eliminate schema evolution work.
Feature gaps (e.g., limited support for complex joins, global transactions) can lead to unexpected consistency issues.
Java‑only driver solutions exclude services written in other languages.
Running a proxy adds latency and requires monitoring, scaling and high‑availability design.
Emergence of native distributed SQL databases
Modern distributed databases embed sharding, replication and consensus (e.g., Raft) directly in the storage engine, offering MySQL‑compatible query interfaces while handling data distribution transparently. Representative systems include:
TiDB – a MySQL‑compatible NewSQL database that uses a separate SQL layer and a distributed key‑value store (TiKV) with Raft replication.
OceanBase – a high‑performance distributed relational database that supports MySQL protocol and provides strong consistency.
Aurora (AWS) and PolarDB (Alibaba Cloud) – cloud‑native services that extend MySQL with automated scaling and fault‑tolerance.
These platforms eliminate the need for custom sharding middleware but introduce new concepts such as distributed indexing, cross‑shard transactions and cluster‑wide configuration.
Guidelines for selecting a solution
If the workload already exhibits massive table sizes, high read/write contention, and the team is prepared to adopt new operational models, a native distributed SQL database is usually the most future‑proof choice.
When the existing application stack is tightly coupled to Java and the migration window is limited, an intermediate sharding middleware (e.g., ShardingSphere) can provide a gradual path while preserving MySQL client compatibility.
Consider the learning curve for distributed transaction handling, global secondary indexes and failure recovery; legacy DBA expertise may need to be supplemented with knowledge of consensus protocols and cluster management.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
ITPUB
Official ITPUB account sharing technical insights, community news, and exciting events.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
