Case study
mysqlsmom
A Python tool for synchronizing MySQL data to Elasticsearch through full loads and binlog-based incremental updates.
Role · Creator
- Python
- MySQL
- Redis
- Elasticsearch
01
Overview
- Context
- Applications needed Elasticsearch indexes to follow MySQL data through an initial full load and subsequent incremental changes.
- My contribution
- Created and published the Python project, its transformation pipeline, and its full and incremental synchronization modes.
- Technology
- Python, MySQL binlog, Redis, and Elasticsearch.
- Result
- The public repository had 281 GitHub stars in the verified 2026-08-25 snapshot.
02
The Problem
Keeping Elasticsearch aligned with MySQL requires both an initial full load and a resumable incremental change stream with custom transformation logic.
03
My Role
Creator
- Designed the Python synchronization flow around MySQL binlog events.
- Implemented Elasticsearch synchronization, custom transformation pipelines, and Redis-backed binlog checkpoints.
- Published and maintained the project as open-source software.
04
Architecture
A focused map of the components and responsibility boundaries that matter to this project.
Component map
Full and incremental synchronization components
- 01MySQL source
Tables and row-based binlog
- 02Full-load reader
Initial table synchronization
- 03Binlog reader
Insert and update events
- 04Transform pipeline
Configurable row-to-document logic
- 05Redis checkpoint
Last binlog filename and position
- 06Elasticsearch
Search-index destination
MySQL sourceFull-load readerinitial rowsMySQL sourceBinlog readerbinlogFull-load readerTransform pipelinerowsBinlog readerTransform pipelineeventsBinlog readerRedis checkpointresume positionTransform pipelineElasticsearchindex documents
MySQL feeds two processing paths: an initial full-load reader and an incremental binlog reader. Both use configurable transformation logic before documents reach Elasticsearch, while Redis stores the incremental reader's resume position. - 01MySQL source
05
How It Works
The primary sequence that moves work or data through the system.
Flow
Incremental change processing flow
- 01MySQL change
Inserted or updated row
- 02Binlog event
Row-based change record
- 03Transform / route
Configured filters and handlers
- 04Elasticsearch write
Transformed search document
- 05Checkpoint
Redis filename and position
MySQL changeBinlog eventrecordBinlog eventTransform / routefilterTransform / routeElasticsearch writeindexElasticsearch writeCheckpointsave progress
A MySQL row change becomes a binlog event, passes through configured filters and transformation handlers, and is written to Elasticsearch. After processed work is flushed, the reader records its binlog position in Redis so the stream can resume after a restart. - 01MySQL change
06
Key Technical Decisions
- Problem
- A full data load does not keep Elasticsearch current after it finishes.
- Choice
- Support a full synchronization mode followed by binlog-based incremental updates.
- Why
- The full load establishes the index, while the binlog stream carries later inserts and updates without repeated table scans.
- Trade-off
- Incremental mode depends on row-based MySQL binlogs and must track stream progress across restarts.
- Problem
- An incremental reader needs to resume from the last processed binlog event after a restart.
- Choice
- Store the last binlog filename and position in Redis.
- Why
- A durable checkpoint lets the reader continue from known progress instead of restarting the stream blindly.
- Trade-off
- Redis becomes an additional runtime dependency for incremental synchronization.
07
Challenges
- Transforming MySQL rows and binlog events into Elasticsearch documents through configurable pipelines.
- Keeping an early open-source data tool understandable and usable outside its original environment.
08
Outcome
- Published a reusable Python path for full and incremental MySQL-to-Elasticsearch synchronization.
- Reached 281 GitHub stars by the 2026-08-25 snapshot, providing a public interest signal for the project.
Related public work
09
What I Learned
- Learned
- Incremental synchronization needs an explicit checkpoint boundary as well as a clear source-to-destination transformation path.
- Differently today
- I would separate source reading, transformation, checkpointing, and destination writing behind typed interfaces, add integration tests around restart behavior, and target a supported Python runtime.
- Reflection
- The lasting value of an early open-source tool is both the implementation and the public evidence that other developers found the problem worth solving.