The interaction of microservices?

Until recently the work was supported by essentially monolithic projects, but recently we got a order for a new big project.
Once it was decided to do everything on the RESTFul microservices with Docker. Database - Postgres
Now available:
The Micro Service And
A Micro Service In
Broker event with different event processing
Operator workstation

There is a problem - the arm includes a bunch of pivot tables with different microservices, with filters, sorting and so on. and so. of the services and
Because of this, in the micro service In wound in DB reference to some entity A, so it is possible to build foreign keys.
If the number of microservices with the interactions starts to grow, this will result in a huge number of directories in each micro service + same model with the logic for CRUD
The front may not be the one to filter, as there is a pagination and sampling filters must lie on the database.

I would be grateful if anyone can help and better advise a book to read.
March 23rd 20 at 19:04
3 answers
March 23rd 20 at 19:06
All guides can be identified in a separate micro service, for example. And even when a large volume of related resources should have to look at graphQL
You're so formulaic. I freaked out.
Whatever the answer schemes as one of the bad articles. - fanny_Runolfsson commented on March 23rd 20 at 19:09
@fanny_Runolfsson, trolls, not working with Best Practices, do not ask - Horace_To commented on March 23rd 20 at 19:12
The micro service with separate directories? And how does this solve the problem with filters and sorts? Pitonak code to do it in each dependent from these reference micro service? - milford_Anderson commented on March 23rd 20 at 19:15
@milford_Andersonfirst microsurvey an approach does not work well with the backend applications - there are better front on React/Vue. Secondly there is graphQL, but it should be prepared to be able to.

In principle, when you move from the base to the REST API you already subscribe to the fact that traditional approaches monoliths will have to pull the toilet - Horace_To commented on March 23rd 20 at 19:18
@milford_Anderson, also when microservices rarely used relational database denormalization and more - Horace_To commented on March 23rd 20 at 19:21
"first microsurvey an approach does not work well with the backend applications - there are better front on React/Vue" it seems you have mess in my head.
Data is data, they are stored in the database, their access to build RESTFul services GraphQl, and here at the front with his React/Vue? - milford_Anderson commented on March 23rd 20 at 19:24
@milford_Andersonso that when you switch from querying the DB to the http REST you get the slow train and it's one of the biggest headaches that awaits you. Working with multiple services at a time painful. This is one of the main reasons for the strict separation between back/front - Horace_To commented on March 23rd 20 at 19:27
How the micro service directory solve the problem? How does GraphQL decide? - milford_Anderson commented on March 23rd 20 at 19:30
@milford_Anderson, a separate service directories will solve the issue of isolation and lack of duplication. GraphQL solve the problem of data aggregation from multiple microservices - Horace_To commented on March 23rd 20 at 19:33
Imagine the situation that I am doing a filter query to the micro service B, which uses a global reference, how do I filter on a field from the directory without making a complete sample of And? - milford_Anderson commented on March 23rd 20 at 19:36
@milford_Andersonon the server. You know the IDs of the directories. here and filter on them. What's the problem? - Horace_To commented on March 23rd 20 at 19:39
is that if I need to filter the data by name in the directory I have to select all(!) the essence of micro service And software without the ORM to link them with the requested spravochnikom of micro service manuals, filter, sort, otpugivat and give - milford_Anderson commented on March 23rd 20 at 19:42
@milford_Andersonif the filter name of the directory we get all the directory contents and sends it as the filter in the micro service. GraphQL is good that a cache such requests and implements a similar search - Horace_To commented on March 23rd 20 at 19:45
Yes, the problem is that the backend will do a full sampling of their spirits, no matter how to it this guide will get!
Here I have 100 000 products, and because of this Handbook I would have to make 100 000 products, and then connect software directory and apply the logic of filtering, I don't care where I get the reference, I don't want to do sampling for 100 000 products.
I do this - milford_Anderson commented on March 23rd 20 at 19:48
@milford_Anderson, a typical misconception and fear during the transition from the monolith to micro service. Google GraphQL until blue in the face and stop thinking in the classical direction - Horace_To commented on March 23rd 20 at 19:51
Again I ask, how GraphQL solve the problem of filtering and sorting?
GraphQL just will not make multiple requests in parallel, but this does not solve the initial problem of the backend does, give it cached the reference, does not give the backend to spit on it, he needs to filter, sort, and truncate - milford_Anderson commented on March 23rd 20 at 19:54
@Horace_To, and the help of GraphQL? The question is not how you arrange request-reply and how to implement technically a request? Whatever we do, the data someone needs to pick up from the database, question is how?
"Typical error"? With this approach, the DBMS does not need, they then lost all meaning. And still need a good channel to useless junk to throw from one place to another. And the more powerful servers, we will handle everything instead of specialized systems. Such a non-classical approach looks in my opinion not very inspiring. - osborne commented on March 23rd 20 at 19:57
@osborne, any ideas how to minimize hemorrhagic in this architecture?
The shared directory will be removed sync, but will make a pain in the ass to build filters.
Maybe there are some other ways to solve problems I'm not aware of? - milford_Anderson commented on March 23rd 20 at 20:00
@milford_Anderson, it is not hemorrhagic, and architecture. In microservices the architecture of the application logic moves to the client (the service that initiates requests to the micro service). Technically, the requests are different: depending on the type of service logic and work with it - Horace_To commented on March 23rd 20 at 20:03
About the logic of the client, I did not ask
In my head, so the General logic of a server, the rest depending on the type of client
Filters, pagination, sorting, and everything connected with it - the logic server - milford_Anderson commented on March 23rd 20 at 20:06
@milford_Andersonnot always - Horace_To commented on March 23rd 20 at 20:09
@milford_Andersonto say. IMHO, microservice architecture is not a panacea, the engagement can be reduced and inside the app, the more there is no reason, if you do not spread out on multiple servers. Well when the micro service independent black box, otherwise have a number of problems.
"in the micro service In wound in DB reference to some entity from A" - then it is not a reference, is a table with constraints. I think you need either not to divide the indivisible or to revise the DB structure to make the structure more independent for each module-service. - osborne commented on March 23rd 20 at 20:12
@osborne, But theoretically it is always possible to assume that no matter how we tried to reduce the gearing, there will always be binnestad the customer, where it will be consolidated interface or report to our team when designing microservices is to try to consider, but seams still there
Sorry to move of the essence so simple anymore, already have a business logic, and in our specific case it is impractical to do some of the seams are smooth, hapnem more in other places in the future, but your answer I like - milford_Anderson commented on March 23rd 20 at 20:15
@milford_Anderson, all reports these are the tasks of analysts and they are in a fixed requirements or are using BI Tools that have no relationship to the micro service - Horace_To commented on March 23rd 20 at 20:18
@milford_Andersonabout the reports also do not understand, and the interface is not functional.
I think no matter microservice architecture or just a modular application, your question is more about independence of the modules services, then you need to consider the internal architecture of each module. Without increasing their independence, the problems will multiply. - osborne commented on March 23rd 20 at 20:21
@Horace_To,
not working with Best Practices, do not ask


Best Practices are not universal advice how you perceive them, and only a solution for a certain group situations.

However, your responses did not include an analysis of the situation, clarification of details.
To think with your head, in General, desirable. - fanny_Runolfsson commented on March 23rd 20 at 20:24
March 23rd 20 at 19:08
The service needs a directory service receives it via the rest api, or to the processing of data come with all you need and it spits back the result. What about integrity outside of the scope of micro service, micro service a little worried(I'm about the keys). To make the data easier to drive, invented by different protobuf. For the front is way too protobuf, it is better this way to watch, not graphql/json api/soap, etc. and the microservices is a separate pain in the ass if you have a small team, it is in this sense precisely zero.
March 23rd 20 at 19:10
You are the problem nicely decide without denormalization and data duplication. The only option in a separate micro service summary tables to highlight, to pour the data and to pull them out via the API otherwise on the front of the engine, the OLAP have to be washed down.

Find more questions by tags Service-oriented architectureRESTful API