go-mysql is a pure Go library for handling MySQL network protocol and replication as used by MySQL and MariaDB.
The library solves the problem of integrating MySQL replication and protocol handling into Go applications without external dependencies. It implements the MySQL replication protocol to allow applications to act as replicas, consuming binlog events from a master server and processing them for purposes like cache updates, data synchronization, or event streaming. The approach works by providing low-level protocol handling as a library rather than requiring separate tools or services.
The tool suits projects that need to stream or react to MySQL changes in real time, sync data to other systems like Redis or Elasticsearch, or implement custom MySQL clients and servers in Go. It includes example applications for common tasks like binlog parsing, dumping, and running a fake MySQL server. Teams should adopt this if they want to avoid external MySQL tools and keep replication logic within their Go application.
The project maintains continuous integration across multiple architectures including amd64, s390x, arm64, and arm on Linux, with FreeBSD support sporadically tested by developers. The library follows Go's minimum version requirements and is not compatible with TinyGo. Example applications are provided in the repository and can be built to demonstrate replication, incremental dumping, client operations, and fake server functionality.