Apache ShardingSphere

active

by Apache Software Foundation · since 2016 · also known as ShardingSphere, Sharding-JDBC, ShardingSphere-Proxy

Apache sharding middleware that adds sharding, read/write splitting and encryption over MySQL or Postgres.

relationaldatabase engineopen source (permissive)mature

Overview

Apache ShardingSphere is a database middleware ecosystem that layers distributed capabilities on top of existing MySQL, PostgreSQL, openGauss and other databases instead of replacing them. It comes as ShardingSphere-JDBC, an embedded Java driver, and ShardingSphere-Proxy, a standalone server that speaks MySQL or PostgreSQL protocol. Pluggable features cover data sharding, read/write splitting, XA or BASE distributed transactions, data encryption and masking, and shadow databases for load testing. It is popular in Chinese Java shops that need to scale MySQL without migrating engines; outside the JVM, and for teams wanting a single managed system, a distributed SQL database is usually simpler.

Strengths & trade-offs

Strengths

  • +Adds sharding to existing MySQL/PostgreSQL without changing engines
  • +Embedded JDBC mode has no extra network hop
  • +Pluggable features: read/write splitting, encryption, masking, shadow DB
  • +DistSQL lets you manage sharding rules with SQL
  • +Apache governance and permissive license

Trade-offs

  • −JDBC mode is Java-only; other languages need the proxy
  • −Cross-shard transactions and complex SQL are limited or slow
  • −You still operate every backend database yourself
  • −Release cadence has slowed (5.5.2 in 2025, 5.5.3 in 2026)

Great for

  • +Scaling Java/Spring applications on sharded MySQL
  • +Transparent column encryption and data masking
  • +Read/write splitting across replicas
  • +Shadow databases for production load testing

Think twice for

  • −Non-JVM stacks without a proxy tier
  • −Teams wanting a managed distributed database
  • −Workloads needing strong cross-shard ACID

Capabilities

Native or official first-party support · 7 of 25 tracked

✓Transactions
✓Joins
✓Secondary indexes
✓Change data capture
✓Durable persistence
✓Encryption at rest
✓Role-based access
–Full-text search
–Vector search
–Geospatial
–JSON
–Triggers
–Stored procedures
–Materialized views
–TTL / expiry
–Pub/Sub
–Columnar storage
–In-memory
–Compression
–Time travel
–Branching
–Online schema changes
–Streaming ingest
–Offline sync
–Runs in WebAssembly

Scale & consistency

Comfortable data size
Large · ≤ 1 PB
Horizontal scaling
Addon
Multi-region
No
Transactions
Limited ACID
Consistency
Strong, Eventual
Schema
Strict
Architecture
Distributed, Client server, Embedded
Query languages
SQL, DistSQL

Sharding across many backend MySQL/PostgreSQL instances; capacity depends on the underlying databases.

Deployment

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

Ecosystem

compatible withMySQL, PostgreSQL
apis & protocolsJDBC, MySQL wire protocol (Proxy), PostgreSQL wire protocol (Proxy)
client languagesJava

Alternatives to Apache ShardingSphere

Compare all→
VitessRelational21.2

CNCF-graduated sharding and clustering layer that makes a fleet of MySQL servers look like one database.

apache-shardingsphere vs vitess →
CitusRelational21.1

Postgres extension that shards tables across nodes for multi-tenant SaaS and real-time analytics.

apache-shardingsphere vs citus →
TiDBRelational35.9

MySQL-compatible distributed SQL with a row store for OLTP and a columnar replica for real-time analytics.

apache-shardingsphere vs tidb →
PolarDB-XRelational5.0

Alibaba's open-source, MySQL-compatible shared-nothing distributed SQL with Paxos and columnar indexes.

apache-shardingsphere vs polardb-x →
MultigresRelational12.4

Alpha-stage, Vitess-inspired sharding, pooling and HA layer for unmodified PostgreSQL, led by Supabase.

apache-shardingsphere vs multigres →
MySQLRelational82.3

The web's default open-source SQL database, now on calendar versioning with 9.7 as the LTS line.

apache-shardingsphere vs mysql →

Apache ShardingSphere FAQ

What is Apache ShardingSphere?

Apache ShardingSphere is a relational database by Apache Software Foundation, first released in 2016. Apache ShardingSphere is a database middleware ecosystem that layers distributed capabilities on top of existing MySQL, PostgreSQL, openGauss and other databases instead of replacing them. It comes as ShardingSphere-JDBC, an embedded Java driver, and ShardingSphere-Proxy, a standalone server that speaks MySQL or PostgreSQL protocol. Pluggable features cover data sharding, read/write splitting, XA or BASE distributed transactions, data encryption and masking, and shadow databases for load testing. It is popular in Chinese Java shops that need to scale MySQL without migrating engines; outside the JVM, and for teams wanting a single managed system, a distributed SQL database is usually simpler.

Is Apache ShardingSphere open source?

Yes. Apache ShardingSphere is open source. License: Apache License 2.0.

Does Apache ShardingSphere support ACID transactions?

Partly. Apache ShardingSphere offers limited ACID guarantees (for example, single-record or single-partition transactions), with strong, eventual consistency.

Does Apache ShardingSphere scale horizontally?

Apache ShardingSphere scales horizontally through an official extension, proxy or edition rather than in the core engine. It is comfortable at large scale (≤ 1 PB).

How can I run Apache ShardingSphere?

You can self-host it and embed it in your application.

What is Apache ShardingSphere best for?

Apache ShardingSphere is a strong fit for scaling Java/Spring applications on sharded MySQL; transparent column encryption and data masking; and read/write splitting across replicas. Think twice for non-JVM stacks without a proxy tier.

What are the best alternatives to Apache ShardingSphere?

Common alternatives to Apache ShardingSphere include Vitess, Citus, TiDB, PolarDB-X and Multigres. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

How popular is Apache ShardingSphere?

Apache ShardingSphere ranks #308 of 844 databases on the WhichDB Score (9.5/100), and #100 among relational databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.