Data ownership in microservices: who owns the 'user' data?
Sofia Yamamoto
·715 views
one of the trickiest aspects of microservices is data ownership, especially for core entities like 'user.' our `auth service` needs user IDs and roles, the `profile service` needs name and avatar, `billing service` needs subscription status, and `notification service` needs user preferences and contact info. everyone needs *some* piece of user data.
we've tried event-driven replication for some data, which means eventual consistency. but this can lead to stale data problems and complex debugging when a user's status isn't immediately consistent across services. another approach is for services to call the 'owner' service for any user data they need, but that can lead to chatty APIs and tight coupling.
what's the least-bad approach to managing data ownership for common entities like users across dozens of microservices? how do you balance strong consistency requirements with the need for service autonomy? are there specific patterns, like data replication via change data capture (cdc) or command query responsibility segregation (cqrs), that have been particularly effective for you?
0 comments