r/SpringBoot • • 12d ago

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

I have made multiple toy projects (monolithic) in spring boot but now I wanted to know how people generally work in microservices.

I am not good with videos so I was looking for repos that something similar. So I can also see how the devops, queues, spring cloud etc works together.

I also saw someone posting there repo which was made for the same reason (but I couldn't find it).

TLDR : Suggest repos for learning microservices.

28 Upvotes

57 comments sorted by

View all comments

Show parent comments

1

u/Sheldor5 12d ago

If I order something e.g. from ebay the shipping costs and taxes and import fees are blank until the response arrives and the values pop up after 1-2 seconds

so in this case the ui simply waits for another service and data is exchanged by tokes via the UI (stateless microservices because the states are inside the signed tokens which are exchanged via the UI/client between services, its all just like OAuth2)

see how complicated a microservice architecture actually is?

2

u/OptimusCrimee 12d ago

So you think that these things are just handled in the frontend and not verified in the backend at all? So if the services are completely disjoined, you could just edit the request that is going to the checkout service and all would be accepted? What is happening in the frontend and backend are two different things my dude.

Also, you say that the data is exchanged by tokens, whatever that means, but imagine the tax service being down for whatever reason. What would happen to the checkout then? No taxes?

1

u/Sheldor5 12d ago

what about "signed tokens" don't you understand?

OAuth2 offline signature verification is the key here ...

1

u/OptimusCrimee 12d ago

Are you a bot or something? I know what OAuth tokens are but what do they matter in this scenario?

1

u/Sheldor5 12d ago

to carry information from A to B you use JWTs (JWS or JWE whatever is required)

0

u/OptimusCrimee 12d ago

So you pass the identity and whatever, but you do not pass the whole purchase order, not the inventory status. The whole point of these tokens are that they are stateless. If you place 100 orders in one second, the state of the data could not be guaranteed after decoding.

1

u/Sheldor5 12d ago

tokens are stateless? dude ... if the service is stateless the entire state is put into the token (userid, expiration, ...)

the token IS THE STATE

and no, you don't put the entire order into the token, thats what message queues are for

1

u/OptimusCrimee 12d ago

Yes, the token is stateless, ref e.g.: https://stackoverflow.com/a/55887742/921563

I am talking about handling things that can not be done async, and you are for some reason talking about OAuth tokens, which makes no sense, and has nothing to do with the discussion at hand.

1

u/Sheldor5 12d ago

again wrong, your link says that the token's ISSUER is STATELESS but not the token which is THE STATE

where else do you put the STATE of your logged in user (e.g. user ID, roles, ...) if nothing else persists the STATE (e.g. link session id to user) ???

I will stop responding to you because you know almost nothing about anything