concept collaboration in category .net

appears as: collaboration, collaboration, The collaboration, collaborations, collaborations
Microservices in .NET Core, Second Edition

This is an excerpt from Manning's book Microservices in .NET Core, Second Edition.

Along with continuous delivery comes a DevOps culture, which is also a prerequisite for microservices. To succeed with microservices, everybody must be invested in making the services run smoothly in production and in creating a high level of transparency into the health of the production system. This requires the collaboration of people with operations skills, people with development skills, people with security skills, and people with insight into the business domain, among others.

Figure 5.2. The Loyalty Program microservice uses all three collaboration styles: commands, queries, and events.
ch05 fig 2 horsdal2
Figure 5.8. The event feed in the Special Offers microservice is exposed to other microservices over HTTP and is based on the event store.
ch05 fig 8 horsdal2
HTTP/1.1 201 Created                              #1
Content-Type: application/json; charset=utf-8     #2
Location: /users/4                                #3

{
  "id": 4,
  "name": "Christian",
  "loyaltyPoints": 0,
  "settings": { "interests": ["whisky", "cycling"]
  }
}
Microservices in .NET Core: with examples in Nancy

This is an excerpt from Manning's book Microservices in .NET Core: with examples in Nancy.

Along with continuous delivery comes a DevOps culture, which is also a prerequisite for microservices. To succeed with microservices, everybody must be invested in making the services run smoothly in production and in creating a high level of transparency into the health of the production system. This requires the collaboration of people with operations skills, people with development skills, people with security skills, and people with insight into the business domain, among others.

Collaboration based on events is asynchronous. That is, the microservice that publishes the events doesn’t call the microservices that subscribe to the events. Rather, the subscribers poll the microservice that publishes events for new events when they’re ready to process them. That polling is what I’ll call subscribing to an event feed. Although the polling is made out of synchronous requests, the collaboration is asynchronous because publishing events is independent of any subscriber polling for events.

The collaboration between two microservices can use one, two, or all three of these collaboration styles. Each time two microservices need to collaborate, you must decide which style to use. Figure 4.2 shows the collaborations of Loyalty Program again, but this time identifying the collaboration style I chose for each one.

Figure 4.2. The Loyalty Program microservice uses all three collaboration styles: commands, queries, and events.

Collaboration based on commands and queries should use relatively coarse-grained commands and queries. The calls made between microservices are remote calls, meaning they cross at least a process boundary and usually also a network. This means calls between microservices are relatively slow. Even though the microservices are fine grained, you must not fall into the trap of thinking of calls from one microservice to another as being like function calls in a microservice.

Furthermore, you should prefer collaboration based on events over collaboration based on commands or queries. Event-based collaboration is more loosely coupled than the other two forms of collaboration because events are handled asynchronously. That means two microservices collaborating through events aren’t temporally coupled: the handling of an event doesn’t have to happen immediately after the event is raised. Rather, handling can happen when the subscriber is ready to do so. In contrast, commands and queries are synchronous and therefore need to be handled immediately after they’re sent.