Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user

@OneToMany relationship in a microservice enviromentenvironment

Source Link

@OneToMany relationship in a microservice enviroment

I am coming from a typical monolithic background and I've been experimenting a lot with Spring Framework. I have also build some simple microservices communicating with each other etc. Now I want to go a step forward and build my one more complex app based on microservices. Right now I am on the phase where I am doing my research on how to do that. I have a simple idea of composing an online shop app with, let's say , two microservices:

  1. Customer Relationship Service
  2. Order Management Service

What I don't still understand is how could those two services exchange information about customers. In a typical monolithic project I would have just relate a Customer entity with a Order Entity over a @OneToMany relationship, assuming a customer can have more than one order active. But how would this relationship work in a microservice environment without having to read the same data base ?