ShardingSphere模块+流程梳理
2022-04-28 11:35:43   3  举报             
     
         
 ShardingSphere 运行原理、架构涉及、核心组件
    作者其他创作
 大纲/内容
 metaDataContexts
  … …
  查询优化(分片条件)
    SQL审计
  分片SQL执行流程
  L2功能层
  merge()
  ShardingSphereDataSource
  弹性迁移
  应用1
  YamlRootRuleConfigurations
  数据加密
  generateExecutionContext()
  ShardingSphere 核心要素:连接+增量+可插拔
  读写分离
  结果归并(多个执行器结果合并)
  路由引擎(ss-infra-route)
  L1内核层
  ... ....
  SQL执行(多线程异步执行)
  多租户
  影子库
  调度引擎
  ShardingSphereResultSet
  mergeEngine
  execute()
  存储引擎
  SQL路由(策略路由)
  executionUnits
  L3生态圈
  Presto 从对应的 Connector 上读取数据的流程,过程如下:
  ShardingSpherePreparedStatement
  clearPrevious()
  executeQuery() 
  ExecuteProcessEngine
  应用2
  SQL解析(词法+语法)
  SQL
  prepareStatement(sql)
  ShardingSphere 分库分表
  transactionContexts
  serialExecute()||parallelExecute()
  ExecutionContext
  connection
  数据库协议
  dataSourceMap
  MS SQL
  核心流程
  parse()
  rewrite()
  归并引擎(ss-infra-merge)
  getConnection()
  executeQuery0()
  SQL改写(真实SQL)
  查询优化器
  异构数据源
  route()
  sqlParserEngine
  权限引擎
  mergeQuery(queryResults)
  kernelProcessor
  改写引擎(ss-infra-rewrite)
  My SQL
  routeContext
  sqlStatement
  事务引擎
  TTL
  YamlEngine
  ShardingSphereConnection
  分布式治理
  执行引擎(ss-infra-executor)
  sqlUnit
  createDataSource()
  逻辑表+原始JDBC-API规范
  分片SQL模块流程
  解析引擎(ss-sql-parser)
  三层结构的可插拔内核
  数据分片
  dataSource
  transactionManager
  createExecutionContext()
  shardingsphere├── shardingsphere-agent  对接APM├── shardingsphere-db-protocol  对接APM├── shardingsphere-distribution  打包发布├── shardingsphere-db-protocol  对接APM├── **shardingsphere-features  功能特性目录**│   ├── shardingsphere-db-discovery 基于MGR的主从切换│   ├── shardingsphere-encrypt 加密解密│   ├── **shardingsphere-rewrite-splitting 读写分离**│   ├── **shardingsphere-sharding 分库分表功能**│   │   ├── shardingsphere-sharding-api api和spi│   │   ├── **shardingsphere-sharding-core 核心,分库分表功能细节**│   │   └── shardingsphere-sharding-spring spring入口,集成spring和spring boot│   └── shardingsphere-shadow 影子库├── shardingsphere-governance  治理,写ZK,并给UI提供API├── **shardingsphere-infra  引擎内核**│   ├── shardingsphere-infra-authority proxy权限配置│   ├── shardingsphere-infra-binder SQL解析结果转换│   ├── **shardingsphere-infra-common 基础对象和工具**│   ├── shardingsphere-infra-context 封装的上下文集合│   ├── **shardingsphere-infra-executor 引擎-执行引擎**│   ├── **shardingsphere-infra-merge 引擎-归并引擎**│   ├── **shardingsphere-infra-parser 引擎-解析引擎**│   ├── **shardingsphere-infra-rewrite 引擎-改写引擎**│   ├── **shardingsphere-infra-route 引擎-路由引擎**│   └── shardingsphere-infra-optimize 引擎-优化引擎(新增)├── **shardingsphere-jdbc  JDBC入口**├── **shardingsphere-proxy  proxy入口**├── shardingsphere-scaling  数据迁移├── shardingsphere-sql-parser  Antlr3 SQL解析└── shardingsphere-transaction  分布式事务集成(XA和Seata)
  SQLRewriteEngine
  metaData
  ExecutorEngine
  数据库接入
  Oracle
  Postgep SQL
  SQLRouteEngine
   
 
 
 
 
  0 条评论
 下一页
  
   
   
   
   
  
  
  
  
  
  
  
  
 