【Design Pattern】Microservices - Audit Logging Pattern

Posted by 西维蜀黍 on 2021-06-29, Last Modified on 2022-12-10

Context

You have applied the Microservice architecture pattern.

Problem

How to understand the behavior of users and the application and troubleshoot problems?

Forces

  • It is useful to know what actions a user has recently performed: customer support, compliance, security, etc.

Solution

Record user activity in a database.

Examples

This pattern is widely used.

Resulting Context

This pattern has the following benefits:

  • Provides a record of user actions

This pattern has the following drawbacks:

  • The auditing code is intertwined with the business logic, which makes the business logic more complicated

Reference