microservices

Api Gateway and Sharing Service Models

一笑奈何 提交于 2020-08-26 03:37:28
问题 The short version of my question is that I'm trying to wrap my head around how models are "shared" between an API Gateway and internal microservices. I assume that the gateway can be responsible for transforming calls to multiple services and returning a new aggregated representation of the data. How does the gateway know about the available models from the microservices? In my simple example. I have: API Gateway User Service Restaurant Service User Service This rest service would expose an

Communication between microservices - request data

妖精的绣舞 提交于 2020-08-22 09:36:26
问题 I am dealing with communication between microservices. For example ( fictive example, just for the illustration ): Microservice A - Store Users (getUser, etc.) Microservice B - Store Orders (createOrder, etc.) Now if I want to add new Order from the Client app, I need to know user address. So the request would be like this: Client -> Microservice B (createOrder for userId 5) -> Microservice A (getUser with id 5) The microservice B will create order with details (address) from the User

How to filter and sort data from multiple microservices?

霸气de小男生 提交于 2020-08-21 04:47:19
问题 We have microservices which work with different, but related data. For example, ads and their stats. We want to be able to filter, sort and aggregate this related data for UI(and not only for it). For example, we want to show to a user ads which have 'car' in their text and which have more than 100 clicks. Challenges: There could be a lot of data. Some users have millions of rows after filtration Services doesn't have all the data. For example, for statistics service ad without stats == non

Is it possible to combine REST and messaging for microservices?

送分小仙女□ 提交于 2020-08-02 12:25:19
问题 We have the first version of an application based on a microservice architecture. We used REST for external and internal communication. Now we want to switch to AP from CP (CAP theorem)* and use a message bus for communication between microservices. There is a lot of information about how to create an event bus based on Kafka, RabbitMQ, etc. But I can't find any best practices for a combination of REST and messaging. For example, you create a car service and you need to add different car

Is it possible to combine REST and messaging for microservices?

孤者浪人 提交于 2020-08-02 12:25:11
问题 We have the first version of an application based on a microservice architecture. We used REST for external and internal communication. Now we want to switch to AP from CP (CAP theorem)* and use a message bus for communication between microservices. There is a lot of information about how to create an event bus based on Kafka, RabbitMQ, etc. But I can't find any best practices for a combination of REST and messaging. For example, you create a car service and you need to add different car

Microservices: how to handle foreign key relationships

落花浮王杯 提交于 2020-07-31 06:13:29
问题 Microservices architecture suggest that each service should handle it's own data. Hence any service (Service A) dependent on data owned by other service (service B) should access such data not by making direct DB calls but through the api provided by the second service (service B). So what does microservices best practices suggest on checking foreign key constrains. Example: I am developing a delivery feature (microservice 1) for products and certain products are deliverable to only certain