Backend Development 10 min read

Decoupling Service Data Dependencies with Real‑Time Data Synchronization and Redundancy

This article analyzes the data‑dependency challenges in microservice‑based supply‑chain systems, critiques an initial IN‑query approach, proposes a data‑redundancy design, and ultimately presents a decoupled real‑time synchronization solution using the Bifrost middleware to improve performance and consistency.

Top Architect
Top Architect
Top Architect
Decoupling Service Data Dependencies with Real‑Time Data Synchronization and Redundancy

Microservices split applications into minimal units, but in a supply‑chain system the product, order, and purchase services inevitably depend on shared product data, leading to inefficient IN‑queries and heavy load on the product service.

The initial design called the product service first, then used IN statements in order and purchase services, which caused slow queries, timeouts, and cascading failures as product data grew.

To address this, a data‑redundancy scheme was introduced: product fields were duplicated in order and purchase records, allowing direct queries without calling the product service. While this improved query speed, it introduced consistency challenges and increased storage.

A more robust approach was then proposed: real‑time synchronization of product‑related tables (categories, batch numbers, warranty types, etc.) to the databases of dependent services, keeping the schema unchanged and prohibiting modifications from those services.

The solution relies on an open‑source change‑data‑capture middleware that meets requirements for real‑time, incremental, MySQL‑to‑MySQL sync without custom business logic. After evaluating several options, Bifrost was selected for its UI, simple architecture, active maintenance, and built‑in monitoring.

Using Bifrost, product data changes are streamed to order and purchase databases, eliminating cross‑service calls during queries, reducing latency, and simplifying error handling. The architecture also reduces storage overhead compared to full data redundancy.

Although Bifrost lacks clustering for high availability, it has performed reliably in production. The final architecture resolves service data‑dependency issues, allowing each service to focus on its core logic while maintaining consistent product information across the system.

microservicesservice architecturereal-time synchronizationData RedundancyBifrost
Top Architect
Written by

Top Architect

Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.