jettify / aiomysql_replication

(Abandoned )aiomysql_replication - implementation of MySQL replication protocol build

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aiomysql_replication (Work in Progress)

aiomysql_replication - implementation of MySQL replication protocol build on top of aiomysql and PyMySQL for asynico (PEP-3156/tulip). This library is fork of python-mysql-replication with asyncio support.

Basic Example

import asyncio
from aiomysql_replication import create_binlog_stream

MYSQL_SETTINGS = {
    "host": "127.0.0.1",
    "port": 3306,
    "user": "root",
    "password": ""
}

loop = asyncio.get_event_loop()


@asyncio.coroutine
def test_example():
    stream = yield from create_binlog_stream(
        connection_settings=MYSQL_SETTINGS, server_id=3, blocking=True,
        loop=loop)

    while True:
        event = yield from stream.fetchone()
        event.dump()
    stream.close()


loop.run_until_complete(test_example())

Use cases

  • MySQL to NoSQL database replication
  • MySQL to search engine replication
  • Invalidate cache when something change in database
  • Audit
  • Real time analytics

Requirements

About

(Abandoned )aiomysql_replication - implementation of MySQL replication protocol build

License:Other


Languages

Language:Python 99.2%Language:Makefile 0.8%