A
A
Arsen Abakarov2019-06-04 18:23:47
RESTful API
Arsen Abakarov, 2019-06-04 18:23:47

Interaction of microservices?

Until recently, at work, he supported essentially monolithic projects, but recently an order came in for a new large project.
It was immediately decided to do everything on RESTFul microservices with docker. DB - Postgres
What is available now:
Microservice A
Microservice B
Event Broker with different strategies for processing events of
the operator's workstation
There was a problem - the workstation includes a bunch of pivot tables from different microservices, with filters, sorting, etc. etc. from services A and B
Because of this, in microservice B, directories for some entities from A were brought into the database, so you can build foreign keys.
If the number of microservices with interactions starts to grow, it will all result in a huge number of directories in each microservice + the same models with logic on CRUD
The front cannot filter everything itself, since there is pagination and the selections with filters must lie on the database.
I would be grateful if anyone can help, or better advise a book to read.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan Shumov, 2019-06-04
@inoise

All directories can be separated into a separate microservice, for example. And with a large amount of related resources, you should already look at graphQL

G
grinat, 2019-06-04
@grinat

The service needs a reference book, the service receives it via the rest api, or it receives data for processing with everything it needs, and it spits out the result back. What is there with integrity outside the scope of the microservice, the microservice does not care much (I'm talking about the keys). To make it easier to drive data, various protobuffs were invented. For the front, by the way, there is also a protobuff, it’s better to look in this direction, and not graphql / json api / soap, etc. Yes, and microservices are a separate hassle, if you have a small team, then there is definitely zero point in this.

A
Artemy, 2019-06-05
@MetaAbstract

You will not beautifully solve this problem without denormalization and data duplication. The only option is to select pivot tables into a separate microservice, pour data there and pull them from there via api, otherwise the OLAP engine will have to be filed at the front.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question