Eloquent relationships between services in microservice architecture
Hello, I am moving an application from monolithic to microservices approach in Lumen, in the monolithic app I have orders table and products table with a one to many relationship between them.
Now in a microservices approach it's reasonable to have different service for each.
My issue is that I used to have a page responsible for displaying user orders with products using 'with' keyword for eager loading, and also allows the user to filter result by the name of the product.
I am asking what is the best way to accomplish this in a microservices approach.
Sorry for inconvenience. I am using different database for each microservice so I can't use eloquent relationships, order database holds the order information and products database holds the products information. I want to be able to retrieve an order and all it's products. @marosmjartan
Is it even possible for laravel or lumen to handle more than 1 database? Wow, I don't even know that. I recommend merge these 2 databases and create eloquent relationships. But if this is not possible for you for some reason. You should try something like this: