Architectural Patterns and Styles Flashcards
7 cards from real CPSA practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Architectural Patterns and Styles flashcards as text
Which microservices pattern coordinates a sequence of local transactions across multiple services using events or messages to maintain data consistency?
Answer: Saga Pattern
The Saga pattern breaks a distributed transaction into a series of local transactions, each publishing events that trigger the next step, with compensating transactions for rollback.
In microservices architecture, an API Gateway primarily serves which function?
Answer: Acting as a single entry point that routes, aggregates, and cross-cuts concerns for client requests
An API Gateway consolidates routing, authentication, rate limiting, and response aggregation so clients interact with one endpoint instead of many services.
The Circuit Breaker pattern in distributed systems is designed to prevent which specific failure mode?
Answer: Cascading failures caused by repeatedly calling a failing remote service
A Circuit Breaker monitors failure rates and, after a threshold is exceeded, stops forwarding calls to the failing service, giving it time to recover and preventing overload.
What is the key characteristic that distinguishes Choreography-based sagas from Orchestration-based sagas?
Answer: In choreography, each service reacts to events autonomously without a central controller
In choreography, services react to domain events published by other services without a central orchestrator, leading to decentralized and loosely coupled coordination.
The Backend for Frontend (BFF) pattern solves which architectural problem?
Answer: Tailoring API interfaces to the specific needs of each client type (e.g., mobile vs. web)
BFF creates a dedicated backend for each type of frontend client, allowing each to evolve independently with an API optimized for its unique needs.
Which pattern ensures that a message is reliably published to a message broker even when the publishing service and broker are temporarily unavailable?
Answer: Transactional Outbox Pattern
The Transactional Outbox writes the event to an outbox table in the same database transaction as the business operation, and a relay process then publishes it to the broker.
In microservices, the Sidecar pattern deploys a helper process alongside each service instance. What is a typical use case?
Answer: Handling cross-cutting concerns like logging, monitoring, and service mesh proxying
A sidecar container handles infrastructure concerns (TLS termination, logging, metrics collection) transparently, so the main service stays focused on business logic.