Microservices Architecture: Cross Service data sharing

后端 未结 4 919
醉酒成梦
醉酒成梦 2021-01-30 04:46

Consider the following micro services for an online store project:
Users Service keeps account data about the store\'s users (including first name, last name, email address,

4条回答
  •  天涯浪人
    2021-01-30 04:55

    It's totally fine to keep appropriate data in different databases, it's called Polyglot Persistence. Yes, you would like to keep user data and data about purchases separately and use message queue for sync. Millions of users seems fine to me, it's scalability, not design issue ;-)

    In case of search - you probably want to search more than just username, right? So, if you use message queue to update data between services you can also easily route this data to ElasticSearch, for example. And from ElasticSearch perspective it doesn't really matter what field to index - username or product title.

提交回复
热议问题