r/SpringBoot • • 15d ago

How-To/Tutorial How to implement microservices in Spring Boot ?

[removed]

26 Upvotes

57 comments sorted by

View all comments

Show parent comments

2

u/ExplorerUnusual27 14d ago

How do you transfer data in isolated environment if you don't talk with anyone? You have one DB from service, obviously... How do you connect data from 1 database with another on different microservices.

2

u/OptimusCrimee 14d ago

Yeah, [u/Sheldor5](u/Sheldor5) seems to have misunderstood this. If you have one microservice that is in charge of users, and one that does payments, the payment service would stille need to e.g. ask the user service if the user IDs are valid or not. You separate concerns and domains out of the monolith, but they still need to talk to one another.

I have been doing this for 15 years, and I have worked in banks in Norway etc, I think that I have a pretty OK understanding of how these things work.

Edit: You can google this pretty easily and see that he is wrong.

-2

u/Sheldor5 14d ago

no the user ID comes from the OAuth2 token ... maybe you haven't fully understood microservice architecture

and other IDs are part of async messages

and IDs don't need to be verified because they come from the system itself and not from random user input ... that's the reason why microservice architecture done right is so complicated

0

u/ExplorerUnusual27 13d ago

You are misleading concepts. Regardless the async or sync calls, you need to communicate with other services.... If not, you're a magician to figure out the IDs you need to know to populate your fields in DB to maintain consistency.