当前位置:网站首页>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 在实时同步过程中,多个已有特性可以使得同步过程更加灵活,适应各类业务需求:
边栏推荐
- Arithmetic operations and related exercises in C language
- About text selection in web pages and counting the length of selected text
- info [email protected]: The platform “win32“ is incompatible with this module.
- buuctf-pwn write-ups (7)
- 为什么只会编程的程序员无法成为优秀的开发者?
- JMeter script parameterization
- Database connection pool and data source
- vChain: Enabling Verifiable Boolean Range Queries over Blockchain Databases(sigmod‘2019)
- Yolov6 training: various problems encountered in training your dataset
- 学习使用php将时间戳转换为大写日期的方法代码示例
猜你喜欢
Why can't programmers who can only program become excellent developers?
Ad20 cannot select the solution of component packaging in PCB editor
C language exercises - (array)
Error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.
Advanced C language (realize simple address book)
实现一个多进程并发的服务器
LeetCode 209. 长度最小的子数组
Mavn 搭建 Nexus 私服
LeetCode 2320. 统计放置房子的方式数
Xilinx Vivado set *. svh as SystemVerilog Header
随机推荐
Error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.
LeetCode_滑动窗口_中等_395.至少有 K 个重复字符的最长子串
taobao.trade.memo.add( 对一笔交易添加备注 )接口,淘宝店铺插旗接口,淘宝订单插旗API接口,oAuth2.0接口
STM32 standard firmware library function name (I)
GeoServer offline map service construction and layer Publishing
Fatal: unsafe repository is owned by someone else
fatal: unsafe repository is owned by someone else 的解决方法
[noi Simulation Competition] scraping (dynamic planning)
MFC timer usage
C language exercises - (array)
广州市应急管理局发布7月高温高湿化工安全提醒
C# richTextBox控制显示最大行数
C code audit practice + pre knowledge
【apipost】使用教程
微信小程序使用towxml显示公式
华为面试题: 没有回文串
About text selection in web pages and counting the length of selected text
[development environment] install the visual studio community 2013 development environment (download the installation package of visual studio community 2013 with update 5 version)
Have you learned the wrong usage of foreach
Xilinx Vivado set *. svh as SystemVerilog Header