Kcna Kubernetes And Cloud Native Associate · Free Practice Question Medium
Question 20
Your company is building a cloud-native application that needs to process incoming customer orders in real-time. The orders are processed by multiple independent microservices (payment, inventory, and shipping) that are triggered by events. You want to implement a serverless architecture to manage these microservices, which should scale automatically based on demand and execute only when events occur. Which serverless solution would best fit this architecture?
-
A
Run microservices as always-on containers in a Kubernetes cluster
-
B
Implement serverless functions using AWS Lambda or Azure Functions
-
C
Deploy the microservices as stateful Kubernetes pods
-
D
Use Kubernetes Deployments with ReplicaSets for scaling
Reveal correct answer
Correct answer: B
A.
Always-on containers in a Kubernetes cluster involve managing the infrastructure, and these containers will consume resources even when idle. This is contrary to serverless principles, which aim to execute functions only when required and scale automatically without constant resource consumption.
B.
AWS Lambda and Azure Functions are true serverless solutions designed for event-driven applications. They automatically scale based on demand, only execute when events trigger them, and abstract away infrastructure management. This fits well with the event-driven microservice architecture where each service (payment, inventory, shipping) responds to specific events, reducing operational overhead and cost when services are idle.
C.
Deploying stateful Kubernetes pods would require managing infrastructure and maintaining the state between events, which is contrary to serverless principles. Serverless architectures are stateless and automatically scale based on event triggers, without requiring manual infrastructure management.
D.
Kubernetes Deployments with ReplicaSets provide static scaling, meaning the replicas are fixed unless manually changed or through Horizontal Pod Autoscaling (HPA). This is not a true serverless approach because you are still managing and scaling the infrastructure, whereas serverless solutions abstract infrastructure and only run when triggered by events.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
