Microservices Microservice Design Patterns 3 — Questions and Answers
Question 1: What does the CQRS pattern separate?
- Command (write) and query (read) responsibilities (Correct answer)
- Authentication and authorization
- Logging and monitoring
- Build and deploy stages
Correct answer: Command (write) and query (read) responsibilities
CQRS splits the model used to update data from the model used to read it.
Question 2: Event Sourcing persists application state as what?
- A sequence of immutable events (Correct answer)
- The latest snapshot only
- Normalized relational rows
- Encrypted blobs
Correct answer: A sequence of immutable events
Event Sourcing stores every state change as an append-only event log.
Question 3: The Bulkhead pattern improves resilience by doing what?
- Isolating resources so one failure doesn't sink the whole system (Correct answer)
- Caching all responses
- Compressing payloads
- Centralizing configuration
Correct answer: Isolating resources so one failure doesn't sink the whole system
Bulkheads partition resources like thread pools so a fault stays contained.
Question 4: A Sidecar deploys a helper component in what relationship to the main service?
- Alongside it, sharing the same lifecycle/host (Correct answer)
- On a separate cluster entirely
- Inside the database tier
- As a browser plugin
Correct answer: Alongside it, sharing the same lifecycle/host
A sidecar runs next to the primary application, providing supporting features like logging or proxying.
Question 5: What does the Service Discovery pattern address?
- Locating dynamic network addresses of service instances (Correct answer)
- Encrypting data at rest
- Compiling shared libraries
- Defining UI components
Correct answer: Locating dynamic network addresses of service instances
Service Discovery lets clients find instances whose addresses change dynamically.
Question 6: The Aggregator pattern is used to do what?
- Combine results from multiple services into one response (Correct answer)
- Split a single request into queues
- Encrypt outbound traffic
- Store events permanently
Correct answer: Combine results from multiple services into one response
An aggregator collects and merges data from several services for the client.
Question 7: Which pattern uses a per-client-type backend to tailor APIs to specific frontends?
- Backends for Frontends (BFF) (Correct answer)
- Event Sourcing
- Saga
- Bulkhead
Correct answer: Backends for Frontends (BFF)
BFF provides a dedicated gateway tuned to each client experience, such as mobile or web.
What does the CQRS pattern separate?