Microservice Patterns | Design Patterns | Pre-Defined Data View
img
Home > Design Patterns > Pre-Defined Data View

Pre-Defined Data View (Erl, Naserpour)

How can data collected at runtime from multiple sources be efficiently presented into a pre-determined report format?

Pre-Defined Data View

Problem

It can be highly inefficient to generate a custom report by combining data from multiple sources at runtime, especially when this task is carried out by a set of single-purpose microservices. The quantity of microservices involved will add to the performance overhead and the increased processing time may conflict with the microservices’ performance requirements.

Solution

For a report with an established format and data scope, a pre-defined view can be created and perhaps also partially pre-populated. This alleviates the need for the runtime processing to include the actual assembly of the data into the report. Instead, the runtime processing carried out by the microservices is limited to data retrieval and the population of the pre-defined data view.

Application

The Container Sidecar pattern may be applied to assist with the data collection and view population. There may also be the need to collect even-related data from event queues and event stores.

A microservice instance registry is implemented. This registry is essentially a database of active and currently running microservice instances, their APIs and locations. When a new microservice is instantiated, that instance is registered in the microservice instance registry.

Pre-Defined Data View: Microservice B queries the microservice instance registry to determine whether an instance of Microservice A is active and available.

Microservice B queries the microservice instance registry to determine whether an instance of Microservice A is active and available.

This pattern can be applied by enabling microservice instances to be discovered and by further enabling the self-registration and semi-automated registration of microservice instances, as explained in the complete pattern description.

Module 10: Advanced Microservice Architecture & Containerization.

This pattern is covered in Module 10: Advanced Microservice Architecture & Containerization..

For more information regarding microservice and containerization courses and accreditation,
visit the Microservice Architect Certification program page..