MCPcopy
hub / github.com/apache/shardingsphere

github.com/apache/shardingsphere @5.5.3 sqlite

repository ↗ · DeepWiki ↗ · release 5.5.3 ↗
41,346 symbols 202,905 edges 8,383 files 9,716 documented · 23%
README

Apache ShardingSphere - Enterprise Distributed Database Ecosystem

Building the standards and ecosystem on top of heterogeneous databases, empowering enterprise data architecture transformation

Official Website: https://shardingsphere.apache.org/

GitHub Release Lines of Code

CI Quality Gate Status Technical Debt Maintainability Rating Security Rating codecov

OpenSSF Best Practices

Slack Gitter

X

Star Geographical Distribution of apache/shardingsphere Pull Request Creator Geographical Distribution of apache/shardingsphere Issue Creator Geographical Distribution of apache/shardingsphere

OVERVIEW


Apache ShardingSphere is positioned as Database Plus, a standard and ecosystem built on top of heterogeneous databases. As an operating system layer above databases, ShardingSphere does not create new databases but focuses on maximizing the computing capabilities of existing databases, providing unified data access and enhanced computing capabilities.

Database Plus Core Concept: By building a standardized and scalable enhancement layer above databases, it makes heterogeneous databases as simple to use as a single database, providing unified governance capabilities and distributed computing capabilities for enterprise data architectures.

Connect, Enhance, and Pluggable are the three core pillars of Apache ShardingSphere:

  • Connect: Building database upper-layer standards, quickly connecting applications with multi-modal heterogeneous databases through flexible adaptation of database protocols, SQL dialects, and storage formats, providing unified data access experience;

  • Enhance: As a database computing enhancement engine, transparently providing enterprise-grade capabilities including distributed computing (data sharding, readwrite-splitting, SQL federation), data security (encryption, masking, audit), traffic control (circuit breaker, rate limiting), and observability (monitoring, tracing, analysis);

  • Pluggable: Adopting a micro-kernel + 3-layer pluggable architecture to achieve complete decoupling of kernel, functional components, and ecosystem integration. Developers can flexibly customize unique data architecture solutions that meet enterprise needs, just like building with LEGO blocks.

Differentiation Advantages: - vs Distributed Databases: More lightweight, protecting existing investments, avoiding vendor lock-in - vs Traditional Middleware: Richer features, more complete ecosystem, more flexible architecture - vs Cloud Vendor Solutions: Support multi-cloud deployment, avoid technology binding, autonomous and controllable

ShardingSphere became an Apache Top-Level Project on April 16, 2020, and has been adopted by 19,000+ projects worldwide.

DUAL-ACCESS ARCHITECTURE DESIGN


ShardingSphere adopts a unique dual-access architecture design, providing two access ends - JDBC and Proxy - that can be deployed independently or in hybrid deployment, meeting diverse requirements for different scenarios.

ShardingSphere-JDBC: Lightweight Access End

Positioning: Lightweight Java framework, enhanced JDBC driver

Core Features: - Client-side direct connection: Shares resources with applications, decentralized architecture - High performance, low overhead: Direct database connection with minimal performance loss - Complete compatibility: Compatible with all ORM frameworks (MyBatis, JPA, Hibernate, etc.) - Zero additional deployment: Provided as JAR package, no independent deployment and dependencies required

Use Cases: High-performance Java applications, integrated deployment with business applications, pursuing ultimate performance

ShardingSphere-Proxy: Enterprise Access End

Positioning: Transparent database proxy, independently deployed server-side

Core Features: - Static entry point: Independent deployment from applications, providing stable database access entry - Heterogeneous language support: Supports any MySQL/PostgreSQL protocol compatible client - DBA friendly: Database operation and maintenance management interface, convenient for O&M personnel - Enterprise-grade features: Supports cluster deployment, load balancing, failover

Use Cases: Heterogeneous language environments, database operation and maintenance management, enterprise applications requiring unified access entry

Hybrid Architecture Advantages

By hybridizing ShardingSphere-JDBC and ShardingSphere-Proxy with unified configuration through the same registry center, you can flexibly build application systems suitable for various scenarios:

  • Architectural flexibility: Architects can freely adjust the optimal system architecture
  • Scenario adaptability: Select the most suitable access method according to different business scenarios
  • Unified management: Single configuration, multi-end collaboration, simplifying O&M complexity
  • Progressive evolution: Support smooth evolution path from JDBC to Proxy

AI ABSTRACTION

DeepWiki zread

DOCUMENTATION📜


EN doc CN doc

For full documentation & more details, visit: Docs

CONTRIBUTION🚀🧑💻


For guides on how to get started and setup your environment, contributor & committer guides, visit: Contribution Guidelines

Team


We deeply appreciate community contributors for their dedication to Apache ShardingSphere.

COMMUNITY & SUPPORT💝🖤


:link: Mailing List. Best for: Apache community updates, releases, changes.

:link: GitHub Issues. Best for: design discussions, bug reports, or anything development related.

:link: Slack channel. Best for: instant communications and online meetings, sharing your applications.

:link: X. Best for: keeping up to date on everything ShardingSphere.

:link: LinkedIn. Best for: professional networking and career development with other ShardingSphere contributors.

PROJECT STATUS


:white_check_mark: Version 5.5.4-SNAPSHOT: Actively under development :tada

Extension points exported contracts — how you extend this code

PersistRepository (Interface)
Persist repository. [7 implementers]
mode/spi/src/main/java/org/apache/shardingsphere/mode/spi/repository/PersistRepository.java
FederationMetaDataRefresher (Interface)
Meta data refresher for federation. @param type of SQL statement [16 implementers]
mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/federation/FederationMetaDataRefresher.java
DatabaseChangedHandler (Interface)
Database changed handler. [18 implementers]
mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/dispatch/handler/database/DatabaseChangedHandler.java
NodePath (Interface)
Node path. [32 implementers]
mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/NodePath.java
OptionalSQLTokenGenerator (Interface)
SQL token generator for optional. @param type of SQL statement context [21 implementers]
infra/rewrite/core/src/main/java/org/apache/shardingsphere/infra/rewrite/sql/token/common/generator/OptionalSQLTokenGenerator.java
MergedResult (Interface)
Merged result after merge engine. [12 implementers]
infra/merge/src/main/java/org/apache/shardingsphere/infra/merge/result/MergedResult.java
InlineExpressionParser (Interface)
Inline expression parser. [6 implementers]
infra/expr/core/src/main/java/org/apache/shardingsphere/infra/expr/spi/InlineExpressionParser.java
SQLState (Interface)
SQL state. [32 implementers]
infra/exception/src/main/java/org/apache/shardingsphere/infra/exception/external/sql/sqlstate/SQLState.java

Core symbols most depended-on inside this repo

get
called by 4708
kernel/data-pipeline/dialect/postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/incremental/wal/decode/BaseLogSequenceNumber.java
visit
called by 3292
parser/sql/engine/core/src/main/java/org/apache/shardingsphere/sql/parser/engine/api/SQLStatementVisitorEngine.java
of
called by 2586
examples/shardingsphere-jdbc-example-generator/src/main/java/org/apache/shardingsphere/example/generator/core/yaml/config/YamlExampleConfigurationSupportedValue.java
put
called by 2302
infra/common/src/main/java/org/apache/shardingsphere/infra/rule/attribute/datanode/MutableDataNodeRuleAttribute.java
getStartIndex
called by 2127
parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/SQLSegment.java
getStopIndex
called by 2080
parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/SQLSegment.java
next
called by 1506
infra/merge/src/main/java/org/apache/shardingsphere/infra/merge/result/MergedResult.java
getText
called by 1445
parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/dml/expr/ExpressionSegment.java

Shape

Method 30,894
Class 7,895
Function 1,908
Interface 504
Enum 145

Languages

Java95%
TypeScript5%

Modules by API surface

docs/document/themes/hugo-theme-learn/static/mermaid/mermaid.js919 symbols
docs/community/themes/hugo-theme-learn/static/mermaid/mermaid.js563 symbols
jdbc/src/test/java/org/apache/shardingsphere/driver/state/circuit/metadata/CircuitBreakerDatabaseMetaDataTest.java177 symbols
jdbc/src/test/java/org/apache/shardingsphere/driver/jdbc/core/datasource/metadata/ShardingSphereDatabaseMetaDataTest.java176 symbols
jdbc/src/main/java/org/apache/shardingsphere/driver/state/circuit/metadata/CircuitBreakerDatabaseMetaData.java175 symbols
parser/sql/engine/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/engine/oracle/visitor/statement/type/OracleDDLStatementVisitor.java166 symbols
parser/sql/engine/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/engine/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java160 symbols
parser/sql/engine/dialect/sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/engine/sqlserver/visitor/statement/SQLServerStatementVisitor.java154 symbols
parser/sql/engine/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/engine/mysql/visitor/statement/MySQLStatementVisitor.java151 symbols
parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/DorisStatementVisitor.java148 symbols
jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/adapter/AdaptedDatabaseMetaData.java147 symbols
parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDALStatementVisitor.java136 symbols

Dependencies from manifests, versioned

ch.qos.logback:logback-classic
com.alibaba:transmittable-thread-local
com.atomikos:transactions
com.atomikos:transactions-essentials
com.atomikos:transactions-jdbc
com.atomikos:transactions-jta
com.cedarsoftware:java-util
com.clickhouse:clickhouse-jdbc
com.facebook.presto:presto-jdbc
com.fasterxml.jackson.dataformat:jackson-dataformat-xml
com.fasterxml.jackson.datatype:jackson-datatype-jdk8

Datastores touched

(mysql)Database · 1 repos
demo_ds_0Database · 1 repos
demo_ds_1Database · 1 repos
ds_1Database · 1 repos
db_2Database · 1 repos
read_ds_0Database · 1 repos
read_ds_1Database · 1 repos
dbDatabase · 1 repos

For agents

$ claude mcp add shardingsphere \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact