All Projects → yametech → canal

yametech / canal

Licence: other
redis replication canal slave

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to canal

data-transfer-hub
Seamless User Interface for replicating data into AWS.
Stars: ✭ 102 (+229.03%)
Mutual labels:  replication
mysql-replication
mysql replication binlog php 同步工具
Stars: ✭ 60 (+93.55%)
Mutual labels:  replication
slock
High-performance distributed sync service and atomic DB
Stars: ✭ 50 (+61.29%)
Mutual labels:  replication
kunlun-storage
Kunlun-storage is the storage component for KunlunBase. It's developed based on percona-mysql-8.0.x and contains exclusive features used by KunlunBase, performance enhancements and XA transaction crash safety enhancements without which MySQL would not be able to execute XA transactions reliably under error conditions such as power outage, proces…
Stars: ✭ 2 (-93.55%)
Mutual labels:  replication
dut-iptv
Github repo containing Kodi addons for CanalDigitaal IPTV, F1 TV, KPN/Telfort/XS4All iTV, NLZiet, Telenet, T-Mobile TV, Videoland and Ziggo Go
Stars: ✭ 26 (-16.13%)
Mutual labels:  canal
niqlow
design, solve and estimate discrete dynamic programs.
Stars: ✭ 16 (-48.39%)
Mutual labels:  replication
django-clone
Controlled Django model instance replication.
Stars: ✭ 89 (+187.1%)
Mutual labels:  replication
sql-sync
Offline replication between SQLite (clients) and MySQL (master).
Stars: ✭ 52 (+67.74%)
Mutual labels:  replication
pgcapture
A scalable Netflix DBLog implementation for PostgreSQL
Stars: ✭ 94 (+203.23%)
Mutual labels:  replication
awesome-storage
A curated list of storage open source tools. Backups, redundancy, sharing, distribution, encryption, etc.
Stars: ✭ 324 (+945.16%)
Mutual labels:  replication
Active Directory Scripts
Making my local storage of useful AD Scripts available to everyone.
Stars: ✭ 46 (+48.39%)
Mutual labels:  replication
asyncmy
A fast asyncio MySQL/MariaDB driver with replication protocol support
Stars: ✭ 126 (+306.45%)
Mutual labels:  replication
deploy shard mongodb
This repository has a set of scripts and resources required for deploying MongoDB replicated sharded cluster.
Stars: ✭ 17 (-45.16%)
Mutual labels:  replication
Recon
HA LDAP based key/value solution for projects configuration storing with multi master replication support
Stars: ✭ 12 (-61.29%)
Mutual labels:  replication
bftdb
Tendermint + Sqlite3 = BFT Database Replication
Stars: ✭ 35 (+12.9%)
Mutual labels:  replication
mall4cloud
⭐️⭐️⭐️ Springcloud商城 O2O商城 小程序商城 PC商城 H5商城 APP商城 Java商城 分销商城 多用户商城 uniapp商城 微服务商城
Stars: ✭ 3,915 (+12529.03%)
Mutual labels:  canal
zap
Maintain and replicate ZFS snapshots
Stars: ✭ 48 (+54.84%)
Mutual labels:  replication
pg keeper
Simplified clustering module for PostgreSQL
Stars: ✭ 32 (+3.23%)
Mutual labels:  replication
mono
Collaborative and distributed Markdown text editor, started as a bachelor thesis project at HEIG-VD.
Stars: ✭ 41 (+32.26%)
Mutual labels:  replication
cross-cluster-replication
Synchronize your data across multiple clusters for lower latencies and higher availability
Stars: ✭ 22 (-29.03%)
Mutual labels:  replication

Canal                       中文

Build Status Go Report Card License

Introduction

Canal supports redis 2.x to 5.x and forward compatible replication tools with hybrid (rdb + aof) protocol

Scenes

  • Redis data synchronization across computer rooms
  • Heterogeneous data migration; such as Redis to mysql, MQ, ES, etc.

Design

Simulate the redis slave, then go to dump the rdb and aof of the redis master (add the architecture design diagram later)

Features

  • Support redis 2.x to 5.x data synchronization
  • Support full synchronization and incremental synchronization (continued resume)
  • Support failover
  • Faster

Company Internal use

  • 2k + redis instance data synchronization

Usage

go get github.com/yametech/canal

Basic Usage

package main

import (
	"github.com/yametech/canal"
	"log"
	"os"
	"time"
)

type printer struct{}

func (p *printer) Command(cmd *canal.Command) error {
	log.Printf("[PRINTER] cmd=%v\n", cmd)
	return nil
}

func main() {
	log.SetOutput(os.Stdout)

	cfg, err := canal.NewConfig(
		"127.0.0.1:6379",
		canal.DialKeepAlive(time.Hour*16800),
		canal.DialWithLocalPort(6379), // use specified local port
	)

	if err != nil {
		panic(err)
	}

	repl, err := canal.NewCanal(cfg)
	if err != nil {
		panic(err)
	}

	defer repl.Close()

	if err := repl.Run(&printer{}); err != nil {
		panic(err)
	}
}

Use of breakpoint resume

// starting from the location of an instance example
package main

import (
	"github.com/yametech/canal"
	"log"
	"os"
	"time"
)

type printer struct{}

func (p *printer) Command(cmd *canal.Command) error {
	log.Printf("[PRINTER] cmd=%v\n", cmd)
	return nil
}

func main() {
	log.SetOutput(os.Stdout)

	cfg, err := canal.NewConfig(
		"127.0.0.1:8888",
		canal.DialKeepAlive(time.Minute*5),
	)

	if err != nil {
		panic(err)
	}

	repl, err := canal.FromOffsetCanal(cfg, "0cc79e52c7cdcaa58535bb2ce23f46ee1343246c", 111)
	if err != nil {
		panic(err)
	}

	defer repl.Close()

	if err := repl.Run(&printer{}); err != nil {
		panic(err)
	}
}

Failover usage

//
type printer struct{}

func (p *printer) Command(cmd *canal.Command) error {
	log.Printf("[PRINTER] cmd=%s\n", cmd.String())
	return nil
}

func main() {
	log.SetOutput(os.Stdout)

	cfg, err := canal.NewConfig(
		"127.0.0.1:6379",
		canal.DialKeepAlive(time.Minute*5),
		// canal.DialPassword(""),
	)
	if err != nil {
		panic(err)
	}
	
	cfg.ReplMaster()

	repl, err := canal.NewCanal(cfg)
	if err != nil {
		panic(err)
	}

	defer repl.Close()

	if err := repl.Run(&printer{}); err != nil {
		panic(err)
	}
}

TODO

  • Support c / s structure, grpc cross platform use
  • redis 6.x
  • Support etcd, zk, consul and other storage position
  • Support cluster
  • Automatic maintenance of redis topology structure
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].