Bird
0
0

Given a microservice that stores user data split by country using horizontal decomposition, what happens if a user moves to a new country?

medium📝 Analysis Q4 of 15
Microservices - Migration from Monolith
Given a microservice that stores user data split by country using horizontal decomposition, what happens if a user moves to a new country?
AUser data is deleted and recreated in the new shard automatically
BUser data remains in the original shard without change
CUser data is duplicated in both shards permanently
DUser data must be migrated from one database shard to another
Step-by-Step Solution
Solution:
  1. Step 1: Understand horizontal decomposition by country

    Data is split by country, so each shard holds users from one country.
  2. Step 2: Consider user moving countries

    User data must move to the shard for the new country to maintain consistency.
  3. Final Answer:

    User data must be migrated from one database shard to another -> Option D
  4. Quick Check:

    Moving user = migrate shard data [OK]
Quick Trick: User moves country -> migrate data shard [OK]
Common Mistakes:
  • Assuming data stays in old shard
  • Thinking data duplicates permanently
  • Believing deletion and recreation is automatic

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes