Apache ShardingSphere is an ecosystem composed of a set of open source distributed database middleware solutions. It consists of JDBC, Proxy and Sidecar (under planning), three products that are independent of each other but can be deployed and used together. They all provide standardized data sharding, distributed transactions and database management functions, and can be applied to various diverse application scenarios such as Java isomorphism, heterogeneous languages, cloud native, etc.
Apache ShardingSphere is positioned as relational database middleware, aiming to fully and reasonably utilize the computing and storage capabilities of relational databases in distributed scenarios, rather than implementing a new relational database. It captures the essence of things by focusing on the unchanging. Relational databases still occupy a huge market today and are the cornerstone of each company's core business. They will be difficult to shake in the future. At this stage, we are more focused on increments based on the original foundation rather than subversion.
Apache ShardingSphere 5.x began to focus on pluggable architecture, and the functional components of the project can be flexibly expanded in a pluggable manner. Currently, functions such as data sharding, read-write separation, multiple data copies, data encryption, and shadow database stress testing, as well as support for SQL and protocols such as MySQL, PostgreSQL, SQLServer, and Oracle, are all woven into the project through plug-ins. Developers can customize their own unique system just like using building blocks. Apache ShardingSphere currently provides dozens of SPIs as system extension points, and more are still being added.
ShardingSphere-JDBC
Positioned as a lightweight Java framework, it provides additional services in the JDBC layer of Java. It uses the client to directly connect to the database and provides services in the form of jar packages without additional deployment and dependencies. It can be understood as an enhanced version of the JDBC driver and is fully compatible with JDBC and various ORM frameworks.
Applicable to any JDBC-based ORM framework, such as: JPA, Hibernate, Mybatis, Spring JDBC Template or use JDBC directly.
Supports any third-party database connection pool, such as: DBCP, C3P0, BoneCP, Druid, HikariCP, etc.
Supports any database that implements the JDBC specification. Currently, it supports MySQL, Oracle, SQLServer, PostgreSQL and any database that follows the SQL92 standard.
ShardingSphere-Proxy
Positioned as a transparent database agent, it provides a server that encapsulates the database binary protocol to support heterogeneous languages. Currently, MySQL and PostgreSQL are provided. It can use any access client compatible with the MySQL/PostgreSQL protocol (such as MySQL Command Client, MySQL Workbench, Navicat, etc.) to operate data, making it more friendly to DBAs.
It is completely transparent to the application and can be used directly as a MySQL/PostgreSQL server.
Applicable to any client compatible with MySQL/PostgreSQL protocol.
ShardingSphere-Sidecar (TODO)
Positioned as a cloud-native database proxy for Kubernetes, it proxies all access to the database in the form of Sidecar. A centerless, zero-intrusion solution provides an engagement layer that interacts with the database, namely Database Mesh, also known as database grid.
The focus of Database Mesh is on how to organically connect distributed data access applications and databases. It focuses more on interaction and effectively sorting out the interactions between messy applications and databases. Using Database Mesh, applications and databases that access the database will eventually form a huge grid system. Applications and databases only need to be registered in the grid system. They are all objects managed by the meshing layer.
hybrid architecture
ShardingSphere-JDBC adopts a decentralized architecture and is suitable for high-performance lightweight OLTP applications developed in Java; ShardingSphere-Proxy provides static entry and heterogeneous language support and is suitable for OLAP applications and management and operation of sharded databases. scene.
Apache ShardingSphere is an ecosystem composed of multiple access terminals. By mixing ShardingSphere-JDBC and ShardingSphere-Proxy, and using the same registration center to uniformly configure sharding strategies, application systems suitable for various scenarios can be flexibly built, allowing architects to more freely adjust the best system for the current business. architecture.
1. Data fragmentation
Sub-library & sub-table
Read and write separation
Sharding strategy customization
Non-centralized distributed primary key
2. Distributed transactions
Standardized transaction interface
XA strongly consistent transactions
Flexible affairs
3. Database management
Distributed governance
Elastic scaling
Observability (distributed tracing, metrics)
Data encryption and decryption
Shadow gauge pressure test