concept cross - cut concern in category microservice

appears as: cross-cutting concerns, cross-cutting concerns, cross-cutting concern
The Tao of Microservices

This is an excerpt from Manning's book The Tao of Microservices.

7.6.3. Handling cross-cutting concerns

The final example of refinement is the introduction of cross-cutting concerns, such as caching, tracking, auditing, permission, and so forth. You’ve seen this in earlier chapters, but we’ll now explicitly bring it under the umbrella of the refinement strategy. Instead of adding these capabilities to the code base directly or spending time and effort creating code abstractions to hide them, you can intercept, translate, and generate messages to provide these features.

Microservices in .NET Core: with examples in Nancy

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

Throughout the book, you’ll use OWIN middleware to take care of cross-cutting concerns like request logging and monitoring.

None of these components address the cross-cutting concerns mentioned in the introduction to this chapter: monitoring, request logging, and so on. Furthermore, none of these components are good candidates for places to implement those cross-cutting concerns. Why? Because all the components in figure 8.1 implement things specific to the Shopping Cart microservice. In contrast, cross-cutting concerns aren’t specific to any one microservice. Therefore, you need to implement them in components separate from those in figure 8.1. Looking at Shopping Cart from a different angle, in figure 8.2, you see that it gets HTTP requests through a web server, handles them using its various components, and returns responses to the web server, which then sends them back to the caller.

Figure 8.2. The Shopping Cart microservice takes in HTTP requests through a web server.

As I just mentioned, you want to keep the code for cross-cutting concerns separated from the components in figure 8.1. Furthermore, cross-cutting concerns apply to the microservice as a whole. This means a good place for the code that handles cross-cutting concerns is between the web server and the endpoint handlers in your Nancy modules (see figure 8.3).

Figure 8.3. You can use a pipeline of middleware between the web server and the endpoint handler to handle cross-cutting concerns.