Contents
What is cross-cutting concerns in microservices?
Cross cutting concerns are technical requirements that are commonly applicable for all the features of a software. There are Microservices-based application architectures where they try to make a standalone service for Cross Cutting Concerns like logging, which is called externally over the network via an API call.
How do you handle cross-cutting concerns in microservices?
The cross–cutting concerns you’ll implement include monitoring, logging, passing correlation tokens along with requests between microservices, and security concerns around microservice-to-microservice requests. All these concerns make microservices behave well in production.
Tips for implementing shared libraries As Sam Newman describes in building microservices, it’s important not to introduce unnecessary coupling between microservices. Shared libraries should provide cross-cutting infrastructure rather than service domain logic or product functionality.
How are services modeled in a microservice architecture?
However, fully functional systems rely on the cooperation and integration of its parts, and microservice architectures are not an exception. “In a microservice architecture, services are modeled as isolated units that manage a reduced set of problems.”
How are microservices used to manage shared data?
In this approach rather than allowing microservices to access the database directly, a new microservice is developed. This microservice manages all access to the shared data by the two services. By having a common entry point it is easier to reason about changes in various places.
This is related to the eventual consistency case and the additional microservice case: a microservice handles changes in one part of the system (either by reading from a database, handling events or polling a service) and updates another part of the system with those changes atomically.
This is what is commonly known as data sharing: two separate parts of a system share the same data. If you are familiar with multithreaded programming you have a taste of how hard data sharing can get. However, in contrast to multithreaded applications, data sharing in a distributed architecture has its own sets of problems: