A Change Data Capture (CDC) pipeline that synchronizes data from MySQL to Elasticsearch using Debezium and RabbitMQ.
The system uses a microservices architecture with Docker-containerized components:
- MySQL: Source database storing product data
- Debezium: Captures database changes from MySQL binlog
- RabbitMQ: Message broker for change events
- Elasticsearch: Target database for storing synchronized data
- Product Insertion Service: Adds sample products to MySQL
- Elasticsearch Consumer: Processes messages and updates Elasticsearch
- Docker Engine
- Docker Compose
- Fork & Clone this repository
git clone <repository-url>
cd <project-directory>- Start all services:
sudo docker-compose up -build- Access Elasticsearch shell:
sudo docker exec -it elasticsearch bash- Verify data synchronization:
curl -X GET "http://localhost:9200/products/_search?pretty&size=60"- MySQL on port 3307
- RabbitMQ on ports 5672 (AMQP) and 15672 (Management UI)
- Elasticsearch on port 9200
- Debezium Server on port 8080
- The Product Insertion service adds sample products to MySQL every 2 seconds
- Debezium captures changes from MySQL's binlog
- Change events are published to RabbitMQ exchange
- Elasticsearch Consumer processes the messages and updates Elasticsearch accordingly