I am trying to create a microservice architecture using Lumen / Laravel Passport.
I have a multiple dockerized services, which all run as an separate Lumen app container in different VMs:
- API Gateway service (integrated with Laravel Passport for authentication & request validation to further proceeding)
- Chat Service (service for messaging/chat rooms)
- News Service
- … (and many other services)
All of this services has it’s own separated Redis/MySQL databases e.t.c.
In monolithic application, for example, there was a User table in the database, there was the relations between the tables and so else. I have used JOINs and other queries to retrieve data according to the logical selection for the current user id.
But now I have a general page in the Mobile/Web app for example and I must to get the multiple information from different services for one current visible page.
And to receive this data I am sending multiple requests in the different services
Question:
What is the best/correct practice to store user information using microservices architecture and what is the correct way to retrieve the related data to this user from the other micro services with the minimal memory/time loss? And where to store users information like id, phones e.t.c to avoid the data dublication?
Sorry for possible dublicate. Trying to understand..