KCNA Cloud Native Patterns 5 — Questions and Answers
Question 1: What is the primary purpose of a service registry in a microservices architecture?
- Tracks the network locations of service instances for dynamic discovery (Correct answer)
- Stores shared configuration values for all services
- Manages TLS certificates for inter-service communication
- Aggregates health check results from all services
Correct answer: Tracks the network locations of service instances for dynamic discovery
A service registry maintains a dynamic list of available service instances and their addresses, enabling service discovery in environments where instances change frequently.
Question 2: Which pattern allows a new microservice to gradually take over functionality from a monolith without requiring a big-bang rewrite?
- Strangler Fig (Correct answer)
- Blue-Green Deployment
- Sidecar
- Event Sourcing
Correct answer: Strangler Fig
Strangler Fig wraps the monolith and incrementally routes functionality to new microservices, eventually replacing the monolith entirely.
Question 3: What does the principle of 'loose coupling' mean in microservices design?
- Services have minimal dependencies on each other's internals and can change independently (Correct answer)
- Services share a common database to reduce duplication
- All services must use the same programming language and framework
- Services are deployed together to reduce network latency
Correct answer: Services have minimal dependencies on each other's internals and can change independently
Loose coupling means services interact through well-defined interfaces without knowledge of each other's implementation, enabling independent deployment and evolution.
Question 4: In Event Sourcing, how is the application state stored?
- As an ordered log of domain events rather than current state snapshots (Correct answer)
- As a relational database table with the latest state for each entity
- As key-value pairs in a distributed cache
- As periodic snapshots with a transaction log between snapshots
Correct answer: As an ordered log of domain events rather than current state snapshots
Event Sourcing stores every change as an immutable event, reconstructing current state by replaying the event log from the beginning.
Question 5: Which cloud native pattern involves deploying a proxy alongside a legacy application to add capabilities like logging or TLS without modifying its code?
- Sidecar (Correct answer)
- Adapter
- Ambassador
- Strangler Fig
Correct answer: Sidecar
The Sidecar pattern attaches a companion container to the main application to extend or enhance it without changing the application's code.
Question 6: What is the key advantage of using asynchronous messaging between microservices over synchronous REST calls?
- Services are decoupled and can operate independently even when the other is unavailable (Correct answer)
- Responses are delivered faster due to eliminated serialization overhead
- It eliminates the need for service discovery mechanisms
- It guarantees exactly-once message delivery by default
Correct answer: Services are decoupled and can operate independently even when the other is unavailable
Asynchronous messaging decouples services in time — a producer can send messages even when consumers are down, improving resilience.
Question 7: In cloud native architectures, what is the role of a service mesh control plane?
- Manages and configures the sidecar proxies across all services (Correct answer)
- Handles incoming external traffic and routes it to backend services
- Stores distributed application state across the cluster
- Monitors resource usage and autoscales service replicas
Correct answer: Manages and configures the sidecar proxies across all services
The control plane in a service mesh (e.g., Istio's istiod) configures and manages the data plane sidecar proxies, distributing routing rules and policies.
What is the primary purpose of a service registry in a microservices architecture?