Microservices Core Architectural Principles 3 — Questions and Answers
Question 1: Which pattern decomposes a monolith based on distinct business sub-domains?
- Decompose by transaction
- Decompose by business capability (Correct answer)
- Decompose by table
- Decompose by server
Correct answer: Decompose by business capability
Decomposition by business capability aligns each service with a discrete business function.
Question 2: In microservices, what is the preferred way for services to communicate to maximize loose coupling?
- Direct database reads
- Well-defined APIs and asynchronous messaging (Correct answer)
- Shared in-memory objects
- Global variables
Correct answer: Well-defined APIs and asynchronous messaging
Loose coupling is achieved through explicit APIs and asynchronous, event-driven messaging.
Question 3: What does the principle of 'design for failure' imply for microservices?
- Assume the network is always reliable
- Build resilience because failures are inevitable (Correct answer)
- Avoid timeouts entirely
- Never replicate services
Correct answer: Build resilience because failures are inevitable
Distributed systems must assume failures will happen and build in resilience mechanisms.
Question 4: Which fallacy of distributed computing warns architects most directly when designing service calls?
- The network is reliable (Correct answer)
- Code compiles instantly
- Memory is infinite
- All services use the same language
Correct answer: The network is reliable
'The network is reliable' is a classic fallacy that microservice designs must explicitly guard against.
Question 5: What is the main benefit of organizing teams around services rather than technical layers?
- It enforces a single shared codebase
- It enables cross-functional teams that own a service end-to-end (Correct answer)
- It centralizes all decisions
- It eliminates the need for APIs
Correct answer: It enables cross-functional teams that own a service end-to-end
Conway's Law favors cross-functional teams owning services end-to-end, improving autonomy and delivery speed.
Question 6: A microservice should ideally be:
- Large enough to contain the whole domain
- Small and focused on a single responsibility (Correct answer)
- Stateful and shared
- Tightly bound to the UI layer
Correct answer: Small and focused on a single responsibility
Services should be small and focused, following the single-responsibility principle.
Question 7: Which approach helps prevent cascading failures across services?
- Removing all timeouts
- Circuit breakers and bulkheads (Correct answer)
- Synchronous chained calls
- Sharing thread pools globally
Correct answer: Circuit breakers and bulkheads
Circuit breakers and bulkheads isolate failures and stop them from cascading.
Which pattern decomposes a monolith based on distinct business sub-domains?