Apache ShardingSphere adds sharding, read-write splitting, encryption, and federation across heterogeneous SQL databases. It offers a Java JDBC driver and a standalone database proxy.
Overview
Apache ShardingSphere sits above existing databases as a pluggable enhancement layer rather than replacing them. It unifies access to multiple engines while adding distributed computing, security, traffic control, and observability features for enterprise data architectures.
ShardingSphere-JDBC embeds in Java applications as an enhanced JDBC driver, sharing the app process for low overhead and ORM compatibility. ShardingSphere-Proxy runs as a separate server that speaks MySQL, PostgreSQL, or related wire protocols so non-Java clients and DBAs get a single entry point with cluster and failover options.
Both modes can share configuration through a registry such as ZooKeeper or etcd. Capabilities include horizontal and vertical sharding, master-replica routing, XA and BASE transactions, field encryption and masking, SQL audit and firewall rules, shadow databases for load tests, and SQL dialect translation across vendors.
The architecture uses a micro-kernel with pluggable feature and protocol modules. Compared with monolithic distributed databases, the project emphasizes lighter weight and reuse of current database investments; compared with basic middleware, it advertises a broader governance and ecosystem surface.
Key features
- Data sharding and routing
- Read-write splitting with failover
- Distributed XA and BASE transactions
- Transparent column encryption
- Database proxy for heterogeneous clients
- Embedded JDBC for Java apps
- SQL dialect and protocol adaptation
- Shadow DB and traffic observability
Use cases
- Scale-out MySQL or PostgreSQL
- Encrypt sensitive columns in place
- Unified SQL gateway for polyglot apps
- Stress-test isolation with shadow DBs
- Hybrid JDBC and proxy deployment