Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions best-practices/java-app-best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ summary: 本文介绍了开发 Java 应用程序使用 TiDB 的常见问题与
通常 Java 应用中和数据库相关的常用组件有:

- 网络协议:客户端通过标准 [MySQL 协议](https://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_PROTOCOL.html)和 TiDB 进行网络交互。
- JDBC API 及实现:Java 应用通常使用 [JDBC (Java Database Connectivity)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) 来访问数据库。JDBC 定义了访问数据库 API,而 JDBC 实现完成标准 API 到 MySQL 协议的转换,常见的 JDBC 实现是 [MySQL Connector/J](https://github.com/mysql/mysql-connector-j),此外有些用户可能使用 [MariaDB Connector/J](https://mariadb.com/kb/en/library/about-mariadb-connector-j/#about-mariadb-connectorj)。
- JDBC API 及实现:Java 应用通常使用 [JDBC (Java Database Connectivity)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) 来访问数据库。JDBC 定义了访问数据库 API,而 JDBC 实现完成标准 API 到 MySQL 协议的转换,常见的 JDBC 实现是 [MySQL Connector/J](https://github.com/mysql/mysql-connector-j),此外有些用户可能使用 [MariaDB Connector/J](https://mariadb.com/docs/connectors/mariadb-connector-j/about-mariadb-connector-j#about-mariadb-connectorj)。
- 数据库连接池:为了避免每次创建连接,通常应用会选择使用数据库连接池来复用连接,JDBC [DataSource](https://docs.oracle.com/javase/8/docs/api/javax/sql/DataSource.html) 定义了连接池 API,开发者可根据实际需求选择使用某种开源连接池实现。
- 数据访问框架:应用通常选择通过数据访问框架 ([MyBatis](https://mybatis.org/mybatis-3/zh_CN/index.html), [Hibernate](https://hibernate.org/)) 的封装来进一步简化和管理数据库访问操作。
- 业务实现:业务逻辑控制着何时发送和发送什么指令到数据库,其中有些业务会使用 [Spring Transaction](https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/transaction.html) 切面来控制管理事务的开始和提交逻辑。
Expand Down Expand Up @@ -67,7 +67,7 @@ TiDB 中同时支持两种方式,但更推荐使用第一种将 `FetchSize`

### MySQL JDBC 参数

JDBC 实现通常通过 JDBC URL 参数的形式来提供实现相关的配置。这里以 MySQL 官方的 Connector/J 来介绍[参数配置](https://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration-properties.html)(如果使用的是 MariaDB,可以参考 [MariaDB 的类似配置](https://mariadb.com/kb/en/library/about-mariadb-connector-j/#optional-url-parameters))。因为配置项较多,这里主要关注几个可能影响到性能的参数。
JDBC 实现通常通过 JDBC URL 参数的形式来提供实现相关的配置。这里以 MySQL 官方的 Connector/J 来介绍[参数配置](https://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration-properties.html)(如果使用的是 MariaDB,可以参考 [MariaDB 的类似配置](https://mariadb.com/docs/connectors/mariadb-connector-j/about-mariadb-connector-j#optional-url-parameters))。因为配置项较多,这里主要关注几个可能影响到性能的参数。

#### Prepare 相关参数

Expand Down
2 changes: 1 addition & 1 deletion develop/dev-guide-connection-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ TiDB 中同时支持两种方式,但更推荐使用第一种将 **FetchSize**

### MySQL JDBC 参数

JDBC 实现通常通过 JDBC URL 参数的形式来提供实现相关的配置。这里以 MySQL 官方的 Connector/J 来介绍[参数配置](https://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration-properties.html)(如果使用的是 MariaDB,可以参考 [MariaDB 的类似配置](https://mariadb.com/kb/en/library/about-mariadb-connector-j/#optional-url-parameters))。因为配置项较多,这里主要关注几个可能影响到性能的参数。
JDBC 实现通常通过 JDBC URL 参数的形式来提供实现相关的配置。这里以 MySQL 官方的 Connector/J 来介绍[参数配置](https://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration-properties.html)(如果使用的是 MariaDB,可以参考 [MariaDB 的类似配置](https://mariadb.com/docs/connectors/mariadb-connector-j/about-mariadb-connector-j#optional-url-parameters))。因为配置项较多,这里主要关注几个可能影响到性能的参数。

#### Prepare 相关参数

Expand Down
12 changes: 6 additions & 6 deletions dm/dm-glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ summary: 学习 TiDB Data Migration 相关术语

### Binlog

在 TiDB DM 中,Binlog 通常指 MySQL/MariaDB 生成的 binary log 文件,具体请参考 [MySQL Binary Log](https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_replication.html) 与 [MariaDB Binary Log](https://mariadb.com/kb/en/library/binary-log/)。
在 TiDB DM 中,Binlog 通常指 MySQL/MariaDB 生成的 binary log 文件,具体请参考 [MySQL Binary Log](https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_replication.html) 与 [MariaDB Binary Log](https://mariadb.com/docs/server/server-management/server-monitoring-logs/binary-log)。

### Binlog event

MySQL/MariaDB 生成的 Binlog 文件中的数据变更信息,具体请参考 [MySQL Binlog Event](https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_replication_binlog_event.html) 与 [MariaDB Binlog Event](https://mariadb.com/kb/en/library/1-binlog-events/)。
MySQL/MariaDB 生成的 Binlog 文件中的数据变更信息,具体请参考 [MySQL Binlog Event](https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_replication_binlog_event.html) 与 [MariaDB Binlog Event](https://mariadb.com/docs/server/reference/clientserver-protocol/replication-protocol/1-binlog-events)。

### Binlog event filter

比 Block & allow table list 更加细粒度的过滤功能,具体可参考 [Binlog Event Filter](/dm/dm-binlog-event-filter.md)。

### Binlog position

特定 Binlog event 在 Binlog 文件中的位置偏移信息,具体请参考 [MySQL `SHOW BINLOG EVENTS`](https://dev.mysql.com/doc/refman/8.0/en/show-binlog-events.html) 与 [MariaDB `SHOW BINLOG EVENTS`](https://mariadb.com/kb/en/library/show-binlog-events/)。
特定 Binlog event 在 Binlog 文件中的位置偏移信息,具体请参考 [MySQL `SHOW BINLOG EVENTS`](https://dev.mysql.com/doc/refman/8.0/en/show-binlog-events.html) 与 [MariaDB `SHOW BINLOG EVENTS`](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-binlog-events)。

### Binlog replication 处理单元/ sync 处理单元

DM-worker 内部用于读取上游 Binlog 或本地 Relay log 并迁移到下游的处理单元,每个 Subtask 对应一个 Binlog replication 处理单元。在当前文档中,有时也称作 Sync 处理单元。

### Block & allow table list

针对上游数据库实例表的黑白名单过滤功能,具体可参考 [Block & Allow Table Lists](/dm/dm-block-allow-table-lists.md)。该功能与 [MySQL Replication Filtering](https://dev.mysql.com/doc/refman/8.0/en/replication-rules.html) 及 [MariaDB Replication Filters](https://mariadb.com/kb/en/library/replication-filters/) 类似。
针对上游数据库实例表的黑白名单过滤功能,具体可参考 [Block & Allow Table Lists](/dm/dm-block-allow-table-lists.md)。该功能与 [MySQL Replication Filtering](https://dev.mysql.com/doc/refman/8.0/en/replication-rules.html) 及 [MariaDB Replication Filters](https://mariadb.com/docs/server/ha-and-performance/standard-replication/replication-filters) 类似。

### Bound

Expand Down Expand Up @@ -66,7 +66,7 @@ DM-worker 内部用于从上游导出全量数据的处理单元,每个 Subtas

### GTID

MySQL/MariaDB 的全局事务 ID,当启用该功能后会在 Binlog 文件中记录 GTID 相关信息,多个 GTID 即组成为 GTID Set,具体请参考 [MySQL GTID Format and Storage](https://dev.mysql.com/doc/refman/8.0/en/replication-gtids-concepts.html) 与 [MariaDB Global Transaction ID](https://mariadb.com/kb/en/library/gtid/)。
MySQL/MariaDB 的全局事务 ID,当启用该功能后会在 Binlog 文件中记录 GTID 相关信息,多个 GTID 即组成为 GTID Set,具体请参考 [MySQL GTID Format and Storage](https://dev.mysql.com/doc/refman/8.0/en/replication-gtids-concepts.html) 与 [MariaDB Global Transaction ID](https://mariadb.com/docs/server/ha-and-performance/standard-replication/gtid)。

## L

Expand All @@ -86,7 +86,7 @@ DM-worker 内部用于将全量导出数据导入到下游的处理单元,每

### Relay log

DM-worker 从上游 MySQL/MariaDB 拉取 Binlog 后存储在本地的文件,当前其格式为标准的 Binlog 格式,可使用版本兼容的 [mysqlbinlog](https://dev.mysql.com/doc/refman/8.0/en/mysqlbinlog.html) 等工具进行解析。其作用与 [MySQL Relay Log](https://dev.mysql.com/doc/refman/8.0/en/replica-logs-relaylog.html) 及 [MariaDB Relay Log](https://mariadb.com/kb/en/library/relay-log/) 相近。
DM-worker 从上游 MySQL/MariaDB 拉取 Binlog 后存储在本地的文件,当前其格式为标准的 Binlog 格式,可使用版本兼容的 [mysqlbinlog](https://dev.mysql.com/doc/refman/8.0/en/mysqlbinlog.html) 等工具进行解析。其作用与 [MySQL Relay Log](https://dev.mysql.com/doc/refman/8.0/en/replica-logs-relaylog.html) 及 [MariaDB Relay Log](https://mariadb.com/docs/server/server-management/server-monitoring-logs/binary-log/relay-log) 相近。

有关 TiDB DM 内 Relay log 的目录结构、初始迁移规则、数据清理等内容,可参考 [TiDB DM Relay Log](/dm/relay-log.md)。

Expand Down
4 changes: 2 additions & 2 deletions migrate-from-mariadb.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ summary: 介绍如何将数据从 MariaDB 文件迁移数据到 TiDB。

TiDB 和 [MySQL 兼容](/mysql-compatibility.md),而 MySQL 和 MariaDB 也有很多通用的特性。在迁移数据前需要注意,可能某些 MariaDB 特有的特性和 TiDB 并不兼容。

除了检查本小节介绍的事项之外,建议你参考 [MariaDB Compatibility & Differences](https://mariadb.com/kb/en/compatibility-differences/) 检查相关配置。
除了检查本小节介绍的事项之外,建议你参考 [MariaDB Compatibility and Differences](https://mariadb.com/docs/release-notes/community-server/about/compatibility-and-differences) 检查相关配置。

### 认证

Expand Down Expand Up @@ -61,7 +61,7 @@ GROUP BY

### 系统版本表

TiDB 不支持[系统版本表 (System-Versioned Table)](https://mariadb.com/kb/en/system-versioned-tables/)。但是 TiDB 支持 [`AS OF TIMESTAMP`](/as-of-timestamp.md),可以在某些场景下取代系统版本表。
TiDB 不支持[系统版本表 (System-Versioned Table)](https://mariadb.com/docs/server/reference/sql-structure/temporal-tables/system-versioned-tables)。但是 TiDB 支持 [`AS OF TIMESTAMP`](/as-of-timestamp.md),可以在某些场景下取代系统版本表。

你可以执行下列语句检查受影响的表:

Expand Down