A generic oplog/replication system for microservices providing real-time data synchronization between producers and consumers.
OpLog is a generic oplog and replication system for microservices that provides real-time data synchronization between a producer and multiple consumers. It solves the problem of keeping independent components, such as search engines or recommendation systems, updated with changes from an authoritative database without tight coupling. The system uses MongoDB to store operation logs and exposes a Server-Sent Events API for streaming updates.
Developers building microservices architectures that require real-time data replication, such as those implementing search indexing, multi-region deployments, or public streaming APIs. It is also suitable for teams needing to decouple data producers from consumers in event-driven systems.
OpLog offers a lightweight, self-hosted alternative to commercial replication tools, with built-in support for real-time streaming via SSE, full replication for bootstrapping, and periodic synchronization to ensure data consistency. Its design avoids storing actual data, keeping the source API as the gatekeeper for authentication and authorization.
A generic oplog/replication system for microservices
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses MongoDB's tailable cursor on a capped collection to stream data changes in real-time, enabling immediate updates across consumers without polling.
Provides a standards-compliant Server-Sent Events API with connection recovery via Last-Event-ID headers, ensuring consumers don't miss updates during disconnects.
Allows new consumers to obtain a complete dataset via a replication mode before switching to live updates, essential for bootstrapping services like search indexes.
Supports running agents locally on API nodes or as separate clusters, with UDP/HTTP ingestion and load balancer integration for scalable architectures.
Includes oplog-sync to reconcile the oplog with source data dumps, handling missed updates and maintaining data consistency without agent downtime.
Tightly coupled to MongoDB for storage, limiting flexibility for teams using other databases and adding complexity to non-MongoDB stacks.
The README admits OpLog can miss operations, requiring periodic synchronization with source data, which adds operational overhead and risk of inconsistencies.
Requires deploying oplogd agents, MongoDB clusters, and sync processes, making it resource-intensive to set up and maintain compared to simpler solutions.
Primarily offers a Go consumer library (oplogc), forcing teams using other languages to build custom SSE clients, increasing development effort.