阿里开源的MySQL 数据库增量日志解析,提供增量数据订阅和消费。

agapple 8d6f19cc33 fixed default value il y a 7 ans
client 676cf47987 Merge branch 'master' into table_meta_support il y a 7 ans
common 77342663e3 fixed rds binlog local il y a 7 ans
dbsync 4f00f5ea8d fixed tsdb test il y a 7 ans
deployer 8d6f19cc33 fixed default value il y a 7 ans
driver 4f00f5ea8d fixed tsdb test il y a 7 ans
example a1cf292baa try to avoid use multiline exception directly il y a 7 ans
filter 4d624cf184 [maven-release-plugin] prepare for next development iteration il y a 8 ans
instance 989a69e7be fixed format & import il y a 7 ans
meta 4f00f5ea8d fixed tsdb test il y a 7 ans
parse 1463463f1e fixed data il y a 7 ans
protocol 4f00f5ea8d fixed tsdb test il y a 7 ans
server e8da1c884b table meta support il y a 7 ans
sink 4d624cf184 [maven-release-plugin] prepare for next development iteration il y a 8 ans
store 4d624cf184 [maven-release-plugin] prepare for next development iteration il y a 8 ans
.gitignore 51ac311aa1 fixed git ignore il y a 9 ans
LICENSE.txt a0defe575b init il y a 10 ans
README.md 11d0712291 Update README.md il y a 8 ans
RELEASE.txt a0defe575b init il y a 10 ans
codeformat.xml 7ebb3fd1ab fixed code template and format il y a 10 ans
codetemplates.xml 7ebb3fd1ab fixed code template and format il y a 10 ans
pom.xml 77342663e3 fixed rds binlog local il y a 7 ans

README.md

<div class="iteye-blog-content-contain">

最新更新

  1. canal QQ讨论群已经建立,群号:161559791 ,欢迎加入进行技术讨论。
  2. canal消费端项目开源: Otter(分布式数据库同步系统),地址:https://github.com/alibaba/otter

背景

早期,阿里巴巴B2B公司因为存在杭州和美国双机房部署,存在跨机房同步的业务需求。不过早期的数据库同步业务,主要是基于trigger的方式获取增量变更,不过从2010年开始,阿里系公司开始逐步的尝试基于数据库的日志解析,获取增量变更进行同步,由此衍生出了增量订阅&消费的业务,从此开启了一段新纪元。

ps. 目前内部版本已经支持mysql和oracle部分版本的日志解析,当前的canal开源版本支持5.7及以下的版本(阿里内部mysql 5.7.13, 5.6.10, mysql 5.5.18和5.1.40/48)

基于日志增量订阅&消费支持的业务:

  1. 数据库镜像
  2. 数据库实时备份
  3. 多级索引 (卖家和买家各自分库索引)
  4. search build
  5. 业务cache刷新
  6. 价格变化等重要业务消息

项目介绍

名称:canal [kə'næl]

译意: 水道/管道/沟渠

语言: 纯java开发

定位: 基于数据库增量日志解析,提供增量数据订阅&消费,目前主要支持了mysql

关键词: mysql binlog parser / real-time / queue&topic

工作原理

mysql主备复制实现


从上层来看,复制分成三步:

  1. master将改变记录到二进制日志(binary log)中(这些记录叫做二进制日志事件,binary log events,可以通过show binlog events进行查看);
  2. slave将master的binary log events拷贝到它的中继日志(relay log);
  3. slave重做中继日志中的事件,将改变反映它自己的数据。

canal的工作原理:

原理相对比较简单:

  1. canal模拟mysql slave的交互协议,伪装自己为mysql slave,向mysql master发送dump协议
  2. mysql master收到dump请求,开始推送binary log给slave(也就是canal)
  3. canal解析binary log对象(原始为byte流)

相关文档

See the wiki page for : wiki文档

wiki文档列表

相关资料

相关开源

  1. 阿里巴巴分布式数据库同步系统(解决中美异地机房):http://github.com/alibaba/otter
  2. 阿里巴巴去Oracle数据迁移同步工具(目标支持MySQL/DRDS):http://github.com/alibaba/yugong

问题反馈

  1. qq交流群: 161559791
  2. 邮件交流: jianghang115@gmail.com
  3. 新浪微博: agapple0002
  4. 报告issue:issues

【招聘】阿里巴巴中间件团队招聘JAVA高级工程师
岗位主要为技术型内容(非业务部门),阿里中间件整个体系对于未来想在技术上有所沉淀的同学还是非常有帮助的
工作地点:杭州、北京均可. ps. 阿里待遇向来都是不错的,有意者可以QQ、微博私聊. 
具体招聘内容:https://job.alibaba.com/zhaopin/position_detail.htm?positionId=32666