Giter Club home page Giter Club logo

ticdc's Introduction

TiCDC

Build Status codecov Coverage Status LICENSE Go Report Card

TiCDC is TiDB's change data capture framework. It supports replicating change data to various downstreams, including MySQL protocol-compatible databases, message queues via the open CDC protocol and other systems such as local file storage.

Architecture

architecture

See a detailed introduction to the TiCDC architecture.

Documentation

Blog

Building

To check the source code, run test cases and build binaries, you can simply run:

$ make
$ make test

Note that TiCDC supports building with Go version Go >= 1.16.

When TiCDC is built successfully, you can find binary in the bin directory. Instructions for unit test and integration test can be found in Running tests.

Deployment

You can setup a CDC cluster for replication test manually as following:

  1. Setup a TiDB cluster.
  2. Start a CDC cluster, which contains one or more CDC servers. The command to start on CDC server is cdc server --pd http://10.0.10.25:2379, where http://10.0.10.25:2379 is the client-url of pd-server.
  3. Start a replication changefeed by cdc cli changefeed create --pd http://10.0.10.25:2379 --start-ts 413105904441098240 --sink-uri mysql://root:[email protected]:3306/. The TSO is TiDB timestamp oracle. If it is not provided or set to zero, the TSO of start time will be used. Currently, we support MySQL protocol-compatible databases as downstream sinks only, and will add more sink types in the future.

For details, see Deploy TiCDC.

Quick start

# Start TiDB cluster
$ docker-compose -f ./deployments/ticdc/docker-compose/docker-compose-mysql.yml up -d

# Attach to control container to run TiCDC
$ docker exec -it ticdc_controller sh

# Start to feed the changes on the upstream tidb, and sink to the downstream tidb
$ ./cdc cli changefeed create --pd http://upstream-pd:2379 --sink-uri mysql://root@downstream-tidb:4000/

# Exit the control container
$ exit

# Load data to the upstream tidb
$ sysbench --mysql-host=127.0.0.1 --mysql-user=root --mysql-port=4000 --mysql-db=test oltp_insert --tables=1 --table-size=100000 prepare

# Check sync progress
$ mysql -h 127.0.0.1 -P 5000 -u root -e "SELECT COUNT(*) FROM test.sbtest1"

Contributing

Contributions are welcomed and greatly appreciated. See CONTRIBUTING.md for details on submitting patches and the contribution workflow.

License

TiCDC is under the Apache 2.0 license. See the LICENSE file for details.

ticdc's People

Contributors

3aceshowhand avatar 3pointer avatar 5kbpers avatar amyangfei avatar asddongmen avatar ben1009 avatar csuzhangxc avatar d3hunter avatar dengqee avatar dependabot[bot] avatar ehco1996 avatar glorv avatar gmhdbjd avatar hi-rustin avatar ianthereal avatar july2993 avatar kennytm avatar lance6716 avatar leoppro avatar lichunzhu avatar liuzix avatar maxshuang avatar myonkeminta avatar okjiang avatar overvenus avatar sdojjy avatar shafreeck avatar sleepymole avatar suzaku avatar wangxiangustc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.