Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Mar 3, 2016
1 parent 62407bd commit 3538bbb
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sharding-jdbc-doc/content/post/architecture.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+++
date = "2016-01-08T16:14:21+08:00"
title = "架构图"
weight = 4
weight = 5
+++
# 架构图

Expand Down
31 changes: 31 additions & 0 deletions sharding-jdbc-doc/content/post/conpects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
+++
date = "2016-03-03T16:14:21+08:00"
title = "核心概念"
weight = 4
+++

本文介绍`Sharding-JDBC`包含的一些核心概念。

## LogicTable
数据分片的逻辑表,对于水平拆分的数据库(表),同一类表的总称。例:订单数据根据主键尾数拆分为`10`张表,分别是`t_order_0``t_order_9`,他们的逻辑表名为`t_order`

## ActualTable
在分片的数据库中真实存在的物理表。即上个示例中的`t_order_0``t_order_9`

## DataNode
数据分片的最小单元。由数据源名称和数据表组成,例:`ds_1.t_order_0`。配置时默认各个分片数据库的表结构均相同,直接配置逻辑表和真实表对应关系即可。如果各数据库的表结果不同,可使用`ds.actual_table`配置。

## DynamicTable
逻辑表和真实表不一定需要在配置规则中静态配置。比如按照日期分片的场景,真实表的名称随着时间的推移会产生变化。此类需求`Sharding-JDBC`是支持的,不过目前配置并不友好,会在新版本中提升。

## BindingTable
指在任何场景下分片规则均一致的主表和子表。例:订单表和订单项表,均按照订单ID分片,则此两张表互为`BindingTable`关系。`BindingTable`关系的多表关联查询不会出现笛卡尔积关联,关联查询效率将大大提升。

## ShardingColumn
分片字段。用于将数据库(表)水平拆分的关键字段。例:订单表订单ID分片尾数取模分片,则订单ID为分片字段。`SQL`中如果无分片字段,将执行全路由,性能较差。`Sharding-JDBC`支持多分片字段。

## ShardingAlgorithm
分片算法。`Sharding-JDBC`通过分片算法将数据分片,支持通过等号、`BETWEEN``IN`分片。分片算法目前需要业务方开发者自行实现,可实现的灵活度非常高。未来`Sharding-JDBC`也将会实现常用分片算法,如`range``hash``tag`等。

## SQL Hint
对于分片字段非`SQL`决定,而由其他外置条件决定的场景,可使用`SQL Hint`灵活的注入分片字段。例:内部系统,按照员工登录ID分库,而数据库中并无此字段。`SQL Hint`支持通过`ThreadLocal``SQL`注释(待实现)两种方式使用。
2 changes: 1 addition & 1 deletion sharding-jdbc-doc/content/post/directory_structure.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+++
date = "2016-01-28T16:14:21+08:00"
title = "目录结构说明"
weight = 6
weight = 7
+++

# 目录结构说明
Expand Down
2 changes: 1 addition & 1 deletion sharding-jdbc-doc/content/post/limitations.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+++
date = "2016-01-08T16:14:21+08:00"
title = "使用限制"
weight = 7
weight = 8
+++

# 使用限制
Expand Down
2 changes: 1 addition & 1 deletion sharding-jdbc-doc/content/post/roadmap.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+++
date = "2016-01-08T16:14:21+08:00"
title = "未来线路规划"
weight = 9
weight = 10
+++
# 未来线路规划
1. 更加灵活和多维度的配置。包括spring支持,分片算法inline支持,读写分离配置,水平垂直分片配置,动态表配置等。
Expand Down
2 changes: 1 addition & 1 deletion sharding-jdbc-doc/content/post/soft_transaction.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+++
date = "2016-01-08T16:14:21+08:00"
title = "柔性事务"
weight = 5
weight = 6
+++
# 最大努力送达型

Expand Down
2 changes: 1 addition & 1 deletion sharding-jdbc-doc/content/post/stress_test.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+++
date = "2016-01-08T16:14:21+08:00"
title = "压力测试报告"
weight = 8
weight = 9
chart = true
+++
# 压力测试报告
Expand Down
2 changes: 1 addition & 1 deletion sharding-jdbc-doc/content/post/transaction.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+++
date = "2016-01-29T16:14:21+08:00"
title = "事务支持说明"
weight = 10
weight = 11
+++
# 事务支持说明

Expand Down

0 comments on commit 3538bbb

Please sign in to comment.