myreplication alternatives and similar packages
Based on the "Database" category.
Alternatively, view myreplication alternatives based on common mentions on social networks and blogs.
-
prometheus
The Prometheus monitoring system and time series database. -
tidb
TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://tidbcloud.com/free-trial -
influxdb
Scalable datastore for metrics, events, and real-time analytics -
Milvus
A cloud-native vector database, storage for next generation AI applications -
cockroach
CockroachDB - the open source, cloud-native distributed SQL database. -
vitess
Vitess is a database clustering system for horizontal scaling of MySQL. -
rqlite
The lightweight, distributed relational database built on SQLite -
groupcache
groupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases. -
TinyGo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM. -
VictoriaMetrics
VictoriaMetrics: fast, cost-effective monitoring solution and time series database -
immudb
immudb - immutable database based on zero trust, SQL/Key-Value/Document model, tamperproof, data change history -
go-cache
An in-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications. -
bytebase
Database DevOps and CI/CD for Developer, DBA and Platform Engineering team. -
go-mysql-elasticsearch
Sync MySQL data into elasticsearch -
rosedb
Lightweight, fast and reliable key/value storage engine based on Bitcask. -
pREST
PostgreSQL ➕ REST, low-code, simplify and accelerate development, ⚡ instant, realtime, high-performance on any Postgres application, existing or new -
buntdb
BuntDB is an embeddable, in-memory key/value database for Go with custom indexing and geospatial support -
dbmate
:rocket: A lightweight, framework-agnostic database migration tool. -
xo
Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server -
tiedot
A rudimentary implementation of a basic document (NoSQL) database in Go -
nutsdb
A simple, fast, embeddable, persistent key/value store written in pure Go. It supports fully serializable transactions and many data structures such as list, set, sorted set. -
LinDB
LinDB is a scalable, high performance, high availability distributed time series database. -
cache2go
Concurrency-safe Go caching library with expiration capabilities and access counters -
GCache
An in-memory cache library for golang. It supports multiple eviction policies: LRU, LFU, ARC -
gocraft/dbr (database records)
Additions to Go's database/sql for super fast performance and convenience. -
fastcache
Fast thread-safe inmemory cache for big number of entries in Go. Minimizes GC overhead -
CovenantSQL
A decentralized, trusted, high performance, SQL database with blockchain features -
lotusdb
Most advanced key-value store written in Go, extremely fast, compatible with LSM tree and B+ tree, optimization of badger and bbolt.
Collect and Analyze Billions of Data Points in Real Time
Do you think we are missing an alternative of myreplication or a related project?
README
Go MySql binary log replication listener
Pure Go Implementation of MySQL replication protocol. This allow you to receive event like insert, update, delete with their datas and raw SQL queries. This code has been developed and maintained by Ven at January 2015.
Installation
go get github.com/2tvenom/myreplication
Test
The project is test with:
- Go 1.3.3
- MySQL 5.5, 5.6 and 5.7 (beta)
- Docker 1.4.1 build 5bc2ff8 (functional tests)
It's not tested in real production situation.
Unit tests
go test
Docker tests
Functonal tests with Docker. Test statement based and row based replication. MySql versions 5.5, 5.6, 5.7.
cd tests
sudo ./test.sh
MySQL server settings
In your MySQL server configuration file you need to enable replication:
[mysqld]
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
binlog-format = row #Row based replication
Example
package main
import (
"fmt"
"myreplication"
)
var (
host = "localhost"
port = 3307
username = "admin"
password = "admin"
)
func main() {
newConnection := myreplication.NewConnection()
serverId := uint32(2)
err := newConnection.ConnectAndAuth(host, port, username, password)
if err != nil {
panic("Client not connected and not autentificate to master server with error:" + err.Error())
}
//Get position and file name
pos, filename, err := newConnection.GetMasterStatus()
if err != nil {
panic("Master status fail: " + err.Error())
}
el, err := newConnection.StartBinlogDump(pos, filename, serverId)
if err != nil {
panic("Cant start bin log: " + err.Error())
}
events := el.GetEventChan()
go func() {
for {
event := <-events
switch e := event.(type) {
case *myreplication.QueryEvent:
//Output query event
println(e.GetQuery())
case *myreplication.IntVarEvent:
//Output last insert_id if statement based replication
println(e.GetValue())
case *myreplication.WriteEvent:
//Output Write (insert) event
println("Write", e.GetTable())
//Rows loop
for i, row := range e.GetRows() {
//Columns loop
for j, col := range row {
//Output row number, column number, column type and column value
println(fmt.Sprintf("%d %d %d %v", i, j, col.GetType(), col.GetValue()))
}
}
case *myreplication.DeleteEvent:
//Output delete event
println("Delete", e.GetTable())
for i, row := range e.GetRows() {
for j, col := range row {
println(fmt.Sprintf("%d %d %d %v", i, j, col.GetType(), col.GetValue()))
}
}
case *myreplication.UpdateEvent:
//Output update event
println("Update", e.GetTable())
//Output old data before update
for i, row := range e.GetRows() {
for j, col := range row {
println(fmt.Sprintf("%d %d %d %v", i, j, col.GetType(), col.GetValue()))
}
}
//Output new
for i, row := range e.GetNewRows() {
for j, col := range row {
println(fmt.Sprintf("%d %d %d %v", i, j, col.GetType(), col.GetValue()))
}
}
default:
}
}
}()
err = el.Start()
println(err.Error())
}
Links
- MySql documentation http://dev.mysql.com/doc/internals/en/client-server-protocol.html
- Python implementation. MySql 5.6 checksum compatibility https://github.com/noplay/python-mysql-replication
- Go MySql client. Password encryption method https://github.com/ziutek/mymysql
- Java implementation. Decimal type parsing https://github.com/whitesock/open-replicator
- Ruby implementation. Decimal type parsing https://github.com/jeremycole/mysql_binlog
- Docker files https://github.com/docker-library/mysql