Skip to content

Instantly share code, notes, and snippets.

@lichunzhu
Last active October 22, 2022 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lichunzhu/8fb7345e29dd2e5ec29fb28043f2b4cf to your computer and use it in GitHub Desktop.
Save lichunzhu/8fb7345e29dd2e5ec29fb28043f2b4cf to your computer and use it in GitHub Desktop.
hackathon 2022 P2T RFC

P2T

  • 团队名称:P2T
  • 作者:
  • 项目仓库: https://github.com/orgs/hack2022p2t/repositories
  • 项目进展: | 时间 | 里程碑 | 状态 | | ---- | ---- | ---- | | 2022-10-17 | 完成项目设计 | 完成 | | | 完成 dumpling 模块支持 postgres | | | | DM 集成支持 postgres | | | | DM 支持增量 postgres | |

项目介绍

使得 DM 支持导出 postgres 数据库,帮助 postgres 用户快速迁移到 TiDB。

背景&动机

  • DM: TiDB 的数据迁移工具,负责迁移数据到 TiDB 数据库。

目前 DM 主要支持了 MySQL 数据库迁移到 TiDB,但对 postgres 数据库没有做什么支持,但 postgres 同时也存在大量用户。为帮助这部分用户更方便尝试 TiDB,本项目会扩展 DM 迁移功能帮助用户便捷迁移数据至 DM 并尝试。 而 DM 支持 postgres 以后,DM 的新特性例如高可用,合库合表也可以为 postgres 迁移保驾护航。

项目设计

基本架构简图

postgres sql 导入 TiDB 需要经过两条数据数据路径,包括全量路径与增量路径:

全量部分需要改造 dumpling,使其能够正确连接到 postgres 数据库并转码统一化导出数据提供给 DM 内嵌 lightning,再导入至下游 TiDB 中;

增量部分需要改造 DM binlog reader 模块,使其可以正确解析 postgres binlog 数据并提供给 DM 内嵌 syncer 模块,再适配出正确的 sql 写入下游 TiDB。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment