当前位置:网站首页>TiDB数据迁移场景综述
TiDB数据迁移场景综述
2022-07-02 11:56:00 【添香小铺】
本文档总体介绍可用于 TiDB 的数据迁移方案。数据迁移方案如下:
全量数据迁移。
- 数据导入:使用 TiDB Lightning 将 Aurora Snapshot,CSV 文件或 Mydumper SQL 文件的数据全量导入到 TiDB 集群。
- 数据导出:使用 Dumpling 将 TiDB 集群的数据全量导出为 CSV 文件或 Mydumper SQL 文件,从而更好地配合从 MySQL 数据库或 MariaDB 数据库进行数据迁移。
- TiDB DM (Data migration) 也提供了适合小规模数据量数据库(例如小于 1 TiB)的全量数据迁移功能。
快速初始化 TiDB 集群:TiDB Lightning 提供的快速导入功能可以实现快速初始化 TiDB 集群的指定表的效果。请注意,使用快速初始化 TiDB 集群的功能对 TiDB 集群的影响极大,在进行初始化的过程中,TiDB 集群不支持对外访问。
增量数据迁移:使用 TiDB DM 从 MySQL,MariaDB 或 Aurora 同步 Binlog 到 TiDB,该功能可以极大降低业务迁移过程中停机窗口时间。
TiDB 集群复制:TiDB 支持备份恢复功能,该功能可以实现将 TiDB 的某个快照初始化到另一个全新的 TiDB 集群。
根据迁移数据所在数据库类型、部署位置、业务数据规模大小、业务需求等因素,会有不同数据迁移选择。下面展示一些常用的数据迁移场景,方便用户依据这些线索选择到最适合自己的数据迁移方案。
迁移 Aurora MySQL 到 TiDB
从 Aurora 迁移数据到部署在 AWS 的 TiDB 集群,数据迁移可以分为全量迁移和增量迁移两个步骤进行。请根据你的业务需求选择相应的步骤。
迁移 MySQL 到 TiDB
如果你没有使用 Cloud storage (S3) 服务,而且网络联通和延迟情况良好,那么从 MySQL 迁移数据到 TiDB 时可以参照下面的方案。
如果你对数据迁移速度有要求,或者数据规模特别大(例如大于 1 TiB),并且禁止 TiDB 集群在迁移期间有其他业务写入,那么你可以先使用 Lightning 进行快速导入,然后根据业务需要选择是否使用 DM 进行增量数据 (Binlog) 同步。
分库分表 MySQL 合并迁移到 TiDB
如果你的业务使用了基于 MySQL 分库的方案来存储数据,业务数据从 MySQL 迁移到 TiDB 后,合并这些分表数据到一张合并,那么你可以使用 DM 进行分表合并迁移。
如果分表数据总规模特别大(例如大于 1 TiB),并且禁止 TiDB 集群在迁移期间有其他业务写入,那么你可以使用 Lightning 对分表数据进行快速合并导入,然后根据业务需要选择是否使用 DM 进行增量数据 (Binlog) 的分表同步。
从文件迁移数据到 TiDB
复杂迁移场景
DM 在实时同步过程中,多个已有特性可以使得同步过程更加灵活,适应各类业务需求:
边栏推荐
- C language exercises - (array)
- It's no exaggeration to say that this is the most user-friendly basic tutorial of pytest I've ever seen
- 【NOI模拟赛】伊莉斯elis(贪心,模拟)
- Btrace- (bytecode) dynamic tracking tool
- Solve the problem that El radio group cannot be edited after echo
- IE 浏览器正式退休
- Thoroughly master prototype__ proto__、 Relationship before constructor (JS prototype, prototype chain)
- Makefile 分隔文件名与后缀
- Reuse and distribution
- 【NOI模拟赛】刮痧(动态规划)
猜你喜欢
[email protected]: The platform “win32“ is incompatible with this module."/>info [email protected]: The platform “win32“ is incompatible with this module.

Xilinx Vivado set *.svh as SystemVerilog Header

.NET Core 日志系统
![[apipost] tutorial](/img/f9/717908a72720f152ad49034be64b35.png)
[apipost] tutorial

Reuse and distribution

About text selection in web pages and counting the length of selected text

实用调试技巧

复用和分用

Implement a server with multi process concurrency

Btrace- (bytecode) dynamic tracking tool
随机推荐
Dragonfly low code security tool platform development path
taobao. logistics. dummy. Send (no logistics delivery processing) interface, Taobao store delivery API interface, Taobao order delivery interface, Taobao R2 interface, Taobao oau2.0 interface
可视化搭建页面工具的前世今生
LeetCode 2320. 统计放置房子的方式数
C#延时、在线程中开启定时器、获取系统时间
Factal: Unsafe repository is owned by someone else Solution
871. Minimum refueling times: simple priority queue (heap) greedy question
Arithmetic operations and related exercises in C language
MFC CString 转 char*
Why can't browsers read JSX?
Printf function and scanf function in C language
【无标题】LeetCode 2321. 拼接数组的最大分数
Implement a server with multi process concurrency
php获取数组中键值最大数组项的索引值的方法
qml 弹窗框架,可定制
Wechat applet uses towxml to display formula
传感器数据怎么写入电脑数据库
【题解】Educational Codeforces Round 82
CodeCraft-22 and Codeforces Round #795 (Div. 2)D,E
MFC A对话框调用B对话框函数并传参