# Microservice Architecture Patterns Flashcards

Table of Contents

Microservice Patterns Flashcards

API Gateway   drill microservice_patterns

Front

What is the API Gateway pattern in microservices?

Back

The API Gateway pattern is a single entry point for all client requests in a microservice architecture. It handles requests by routing them to the appropriate microservice, aggregating results, and returning the final response to the client.

Service Registry   drill microservice_patterns

Front

Explain the Service Registry pattern in microservices.

Back

The Service Registry pattern involves maintaining a database of available service instances and their locations. Services register themselves with the registry upon startup and deregister when shutting down. Other services can query the registry to find available instances for communication.

Circuit Breaker   drill microservice_patterns

Front

What is the Circuit Breaker pattern, and how does it work in microservices?

Back

The Circuit Breaker pattern prevents cascading failures in distributed systems. It monitors for failures and encapsulates the logic of preventing a failure from constantly recurring. When the number of failures exceeds a threshold, the circuit breaker "trips," and all further calls to the circuit breaker return with an error or a fallback response, without the protected call being made.

Saga   drill microservice_patterns

Front

Describe the Saga pattern in microservices.

Back

The Saga pattern is used to manage data consistency across microservices in distributed transaction scenarios. It breaks down a distributed transaction into a sequence of local transactions, each performed by a single service. If a step fails, the saga executes compensating transactions to undo the changes made by the preceding steps.

CQRS (Command Query Responsibility Segregation)   drill microservice_patterns

Front

What is the CQRS pattern in microservices?

Back

CQRS separates read and write operations for a data store. It uses different models for updating and reading information, which can maximize performance, scalability, and security. The separation allows for independent scaling of read and write workloads and optimizes each for its specific task.

Event Sourcing   drill microservice_patterns

Front

Explain the Event Sourcing pattern in microservices.

Back

Event Sourcing ensures that all changes to application state are stored as a sequence of events. Instead of storing just the current state, it stores the full history of actions taken to reach the current state. This allows for rebuilding past states and provides a complete audit trail.

Bulkhead   drill microservice_patterns

Front

What is the Bulkhead pattern in microservices?

Back

The Bulkhead pattern isolates elements of an application into pools so that if one fails, the others will continue to function. It's named after the sectioned partitions (bulkheads) of a ship's hull. In software, it involves separating different parts of the application to ensure that if one part fails, the entire application doesn't go down.

Sidecar   drill microservice_patterns

Front

Describe the Sidecar pattern in microservices.

Back

The Sidecar pattern involves deploying components of an application as separate processes or services that run alongside the primary application. These "sidecars" handle peripheral tasks such as logging, monitoring, configuration, or network services. This pattern allows for better separation of concerns and easier management of cross-cutting concerns.

Author: Jason Walsh

j@wal.sh

Last Updated: 2024-10-30 16:43:54