Course contentsShow
← Software Engineering
Lesson 1309 of 1,93339. Microservices ArchitectureFree lesson

Data Duplication vs Data Coupling Trade-offs

When to replicate data across services versus sharing it, and understanding the trade-offs between consistency and coupling.

Data Duplication vs Data Coupling Trade-offs

You'll learn: How to decide between replicating data across microservices versus sharing it, and the critical trade-offs between consistency and coupling.

The Core Dilemma

When designing microservices with separate databases (as we learned in "Database Per Service Pattern"), you face a choice: Should Service A copy data from Service B, or should it call Service B whenever it needs that information?

Data Duplication means Service A stores its own copy of data that originates in Service B. Data Coupling means Service A directly queries Service B (or its database) for that data.

The Trade-offs

Duplicating data gives you:

  • Independence: Service A runs even if Service B is down
  • Performance: No network calls; data is local
  • Autonomy: Each service controls its own storage

But costs you:

  • Eventual consistency: Copies may be stale or temporarily out of sync
  • Storage overhead: Same data exists in multiple places
  • Synchronization complexity: Need mechanisms (events, messaging) to keep copies updated

Coupling data (sharing or calling across services) gives you:

  • Strong consistency: Always reading the source of truth
  • No duplication: Single copy, no sync issues

But costs you:

  • Tight coupling: Services become dependent on each other
  • Availability risk: One service down affects others
  • Performance overhead: Network latency on every request

Making the Choice

Think of it like a library system: Should every branch maintain its own catalog copy (fast, independent, but may be outdated), or call the central office for each lookup (always accurate, but slower and dependent)?

Choose duplication when autonomy and availability matter more than perfect consistency. Choose coupling when accuracy is non-negotiable and services are highly reliable.

Key Takeaway: Data duplication favors service independence and resilience at the cost of consistency; data coupling favors consistency at the cost of service interdependence and availability risks.