Courseiva
Development with AWS ServicesmediumMultiple ChoiceObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A developer is building a chat application using WebSockets. The application runs on multiple EC2 instances and needs to broadcast messages to all connected clients. Which AWS service can handle the WebSocket connections and route messages?

⚠ Common exam trap

It's easy for candidates to confuse Application Load Balancer's WebSocket support (which only proxies connections to a single target) with the need for a managed service that can broadcast to multiple clients, leading them to choose ALB over API Gateway.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Amazon API Gateway WebSocket API

Amazon API Gateway WebSocket API is the correct choice because it natively manages WebSocket connections, maintains persistent bidirectional communication, and can broadcast messages to all connected clients using callback URLs. It handles connection lifecycle (connect, disconnect, default) and integrates with AWS Lambda or other backends to route messages efficiently.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Amazon SQS with long polling

    Why it's wrong here

    Amazon SQS is a message queuing service designed for asynchronous communication between decoupled application components, not for establishing or maintaining persistent, bidirectional WebSocket connections. While long polling can be used to retrieve messages from a queue, it represents a pull-based model for discrete messages, fundamentally different from the real-time, push-based protocol required for interactive chat applications.

  • Application Load Balancer with WebSocket support

    Why it's wrong here

    An Application Load Balancer (ALB) can indeed route WebSocket traffic to backend targets and maintain persistent connections, which is a necessary capability for WebSocket-based applications. However, an ALB's core function is load distribution and routing; it does not inherently provide the server-side logic, state management, or broadcasting mechanisms required to send messages to multiple connected clients in a chat application.

  • Amazon CloudFront with WebSocket support

    Why it's wrong here

    Amazon CloudFront is a Content Delivery Network (CDN) primarily optimized for caching and delivering static and dynamic content globally with low latency, and it can proxy WebSocket connections to improve performance. Nevertheless, CloudFront operates as an edge service and does not offer the backend capabilities or stateful logic necessary to manage WebSocket connection lifecycles or broadcast messages to all active clients in a chat application.

  • Amazon API Gateway WebSocket API

    Why this is correct

    Amazon API Gateway WebSocket API is purpose-built for managing persistent, bidirectional communication channels required by real-time applications like chat. It natively handles WebSocket connection management, including connection establishment and termination, and provides robust mechanisms to send messages to specific clients or broadcast messages to all connected clients, often integrating with backend services like AWS Lambda for message processing.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

One of 724 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.