jacobson's avatar

Microservices structure

Hello everyone, I'm thinking about making a project with Lumen with micro services architecture. I understand the idea that each service is responsible for its part, but not sure how to wrap it in my code. The thing I understand is that I have a main project (frontend) which communicates with each micro service using the REST API. Microservices allows me to easily spread all my data to separate databases. Lets imagine I want to create a shop. Am I right to understand that in this case I have My let's say "lumen project" with frontend, another lumen projects (within the same server for now but can be moved somewhere else) that take care of functionalities like Authorization (#1), Cart (#2), Order(#3), Tickets (#4), Products (#5), Categories (#5) ... etc. Each of this projects are separate instances of lumen project or just within the same project but put to separate folders ?

In case of normal project (not micro services) when you want to fetch a user there is a connection user -> http request to main project -> database -> back to user. In case of micro services with a more complex structure like 1 main project and 5 or more projects with REST endpoints the request looks like this: user -> http request to main project -> main project HTTP request to data endpoint (for example Products) -> fetch data from database -> back to user (1 more jump).

Thank you for understanding, hope someone can clarify this for me :)

0 likes
1 reply
gnacouzi's avatar

Hello @jacobson, i am curious to know how did you go with it, i am in the same position now .

Please or to participate in this conversation.