Backend Development 11 min read

Decoupling Service Data Dependencies with Real‑Time Data Synchronization in a Supply‑Chain Microservices Architecture

This article analyzes data‑dependency issues in a micro‑service based supply‑chain system, compares an initial data‑redundancy approach with a message‑driven solution, and finally proposes a decoupled real‑time synchronization architecture using the Bifrost middleware to improve query performance and maintain consistency.

Architect
Architect
Architect
Decoupling Service Data Dependencies with Real‑Time Data Synchronization in a Supply‑Chain Microservices Architecture

In a supply‑chain system composed of three micro‑services—Product, Order, and Purchase—the initial design kept product responsibilities strictly within the Product service, requiring order and purchase queries to first call the Product service and then use IN statements on product IDs.

This approach quickly revealed performance bottlenecks as product volume grew, causing slow queries, timeouts, and cascading failures across dependent services.

To address these issues, a data‑redundancy scheme was introduced, storing selected product fields directly in Order and Purchase records, which reduced query latency but introduced consistency challenges when product data changed.

Two synchronization strategies were considered: (1) the Product service directly invoking Order and Purchase services to update redundant data—rejected due to tight coupling and rollback complexities; and (2) publishing product‑change events to a message queue, allowing downstream services to update their copies asynchronously—chosen for its loose coupling and retry capabilities.

While the event‑driven approach solved many coupling problems, it still required each service to subscribe to numerous product‑related topics, leading to duplicated code, increased MQ traffic, and coordination difficulties.

The final solution decouples business logic by continuously replicating product‑related tables (including categories, batch numbers, warranty types, etc.) into the databases of dependent services, allowing them to join directly without invoking the Product service.

To implement real‑time replication, the open‑source middleware Bifrost was selected after evaluating Canal, Debezium, DataX, Databus, Flinkx, and Bifrost against criteria such as real‑time support, incremental sync, MySQL compatibility, low‑code integration, and community activity.

After deploying Bifrost, product data synchronization became stable, query performance improved, and services no longer depended on each other for data consistency, though the solution adds storage overhead for replicated tables.

Overall, the architecture demonstrates how a decoupled data‑sync pattern can resolve inter‑service data dependencies in micro‑service environments.

backendmicroservicesData Synchronizationservice architectureData RedundancyBifrost
Architect
Written by

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.

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.