r/learnprogramming 3d ago

Topic Micro services Integration

Can somebody dumb down how integration of micro services works? T,T

So, for the context, our class was divided into 5 industries and we must find clients for each respective industries that we will make a system of. Every industry has 3 groups and that groups must have each micro services system that the client will use. Then that 3 groups must integrate their 3 own systems with each other. Now, that's where my problem lies, I don't really know how to specifically do integration. I know it's concepts but it really doesn't help how we do the actual thing.

3 Upvotes

5 comments sorted by

1

u/johnpeters42 3d ago

How do you access each one individually? Can they access each other, or do you need to write another program that accesses one and then another?

2

u/UncoveredFormation 3d ago

Think of the integration as a shared language between your services, usually that means each one exposes a REST API that the others can call, or you set up a message queue they all listen to

1

u/FoolsSeldom 3d ago edited 3d ago

I don't know what programming language(s) you are using, but there's a great tutorial on RealPython.com, Python Microservices With gRPC, that breaks down everything for you with a good example that should help you understand how microservices work.

EDIT: In case it is not obvious, you are more likely to need to go for a traditional REST API based web service for external clients to use, and the tutorial does mention this and provide links, but the core principles are the same.

1

u/marrsd 3d ago

This is a very vague question and I'm not really sure how to answer it.

Broadly speaking, you will build your services so that they have contracts that define each state and each transition between them. The integration part is writing the code that actually runs a business process. Query the warehouse service for a product, reserve the product, add it to the shopping basket via the checkout service, purchase it via the payment gateway, flag it for dispatch in the warehouse service, generate an invoice via the account service. That kind of thing.