How Data Redundancy and Real‑Time Sync Solve Microservice Data Dependency Issues
This article explains how a supply‑chain system moved from strict microservice boundaries to a data‑redundancy and real‑time synchronization approach, using Bifrost middleware to keep product information consistent across order and purchase services while improving performance and reducing coupling.
In a supply‑chain system we had three services (product, order, purchase) whose master data needed to be shared.
Initially we followed strict micro‑service boundaries: order and purchase services queried the product service and used IN clauses, which caused performance degradation as product data grew and introduced timeouts.
We then introduced data redundancy by storing selected product fields directly in order and purchase tables, improving query speed but creating consistency and coupling problems.
Two synchronization approaches were considered: (1) update product, then call order and purchase services to sync redundant data; (2) publish a message on product change and let order and purchase services subscribe and update their copies.
The first approach suffers from data‑consistency rollback issues and creates a dependency where the product service must call downstream services.
The second, message‑based approach avoids product‑service coupling and allows retry mechanisms for consistency.
To keep the redundant data up‑to‑date we need a real‑time data‑sync middleware that supports MySQL incremental sync without custom business logic. After evaluating Canal, Debezium, DataX, Databus, Flinkx, we chose Bifrost for its UI, simple architecture, active maintenance, and built‑in monitoring.
Using Bifrost we replicate product‑related tables (including category, batch, warranty, etc.) to the order and purchase databases, allowing those services to join directly without calling the product service.
This decoupled design reduces query latency, eliminates cross‑service failures, and saves storage compared to full data redundancy, though it increases the size of order/purchase databases.
Overall the solution stabilizes data dependencies between services, letting each service focus on its core logic.
Architect
Professional architect sharing high‑quality architecture insights. Topics include high‑availability, high‑performance, high‑stability architectures, big data, machine learning, Java, system and distributed architecture, AI, and practical large‑scale architecture case studies. Open to ideas‑driven architects who enjoy sharing and learning.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.