Serving a global barcode-validation API with lowest latency using DynamoDB global tables and Lambda@Edge

Answer Correct answer: D — Use DynamoDB global tables with CloudFront and a Lambda@Edge function for the validation and write-back logic, fronted by Route 53 for lowest global latency.

A global company has a mobile app that displays ticket barcodes. Customers use the tickets on the mobile app to attend live events. Event scanners read the ticket barcodes and call a backend API to validate the barcode data against data in a database. After the barcode is scanned, the backend logic writes to the database's single table to mark the barcode as used. The company needs to deploy the app on AWS with a DNS name of api.example.com. The company will host the database in three AWS Regions around the world. Which solution will meet these requirements with the LOWEST latency?

  1. Host the database on Amazon Aurora global database clusters. Host the backend on three Amazon Elastic Container Service (Amazon ECS) clusters that are in the same Regions as the database. Create an accelerator in AWS Global Accelerator to route requests to the nearest ECS cluster. Create an Amazon Route 53 record that maps api.example.com to the accelerator endpoint
  2. Host the database on Amazon Aurora global database clusters. Host the backend on three Amazon Elastic Kubernetes Service (Amazon EKS) clusters that are in the same Regions as the database. Create an Amazon CloudFront distribution with the three clusters as origins. Route requests to the nearest EKS cluster. Create an Amazon Route 53 record that maps api.example.com to the CloudFront distribution.
  3. Host the database on Amazon DynamoDB global tables. Create an Amazon CloudFront distribution. Associate the CloudFront distribution with a CloudFront function that contains the backend logic to validate the barcodes. Create an Amazon Route 53 record that maps api.example.com to the CloudFront distribution.
  4. Host the database on Amazon DynamoDB global tables. Create an Amazon CloudFront distribution. Associate the CloudFront distribution with a Lambda@Edge function that contains the backend logic to validate the barcodes. Create an Amazon Route 53 record that maps api.example.com to the CloudFront distribution. Correct Answer

Community Votes

D
100%

100% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

Lambda@Edge (not CloudFront Functions) can execute arbitrary backend logic including writing to DynamoDB global tables; combined with CloudFront and Route 53 it delivers the lowest-latency global experience.

A global barcode app needs multi-region low latency and DNS api.example.com. DynamoDB global tables provide multi-Region data access, CloudFront fronts the API, and a Lambda@Edge function runs the validation and write-back logic at the edge — CloudFront Functions cannot perform the database write.

Picking CloudFront Functions (Option C) — they can only manipulate viewer requests/responses and cannot run the backend database write logic required here.

Community Discussion (9 comments)

HunkyBunky 👍 6 Selected: D
D is the proper answer CloudFront Functions - can be used only for manipulation with requests data CloudFront Lambda@Edge functions - can be used for anything, because this is a regular lambda function
alexis123456 👍 6
Correct Answer is A
LeoSantos121212121212121 👍 1 Selected: A
Aurora Global Database provides low-latency read access from multiple Regions and allows writes in a primary Region. Since the system only marks the ticket as used once, it's safe to centralize writes. ECS clusters deployed regionally offer scalable, containerized API backends. AWS Global Accelerator routes users to the closest backend ECS cluster using the AWS edge network, minimizing latency and maximizing performance. Route 53 maps the DNS (api.example.com) to the Global Accelerator endpoint.
AzureDP900 👍 1
Option D is correct DynamoDB global tables: By hosting your database in multiple Regions, you can reduce latency for users located in different parts of the world. CloudFront: You can use CloudFront as a CDN to cache static assets and route dynamic requests to the nearest origin. In this case, it will direct users to the Lambda@Edge function closest to them. Lambda@Edge functions: These allow you to execute code at the edge of the network, which reduces latency and improves performance. Using Lambda@Edge functions in conjunction with DynamoDB global tables provides a great combination for reducing latency and improving performance.
9f02c8d 👍 1
Option: D
red_panda 👍 5 Selected: D
D withoud any doubt. For this simple data, a DynamoDB Table is enought; so global table is perfect. For check logic, cloudfront function is not enought because it is only for manipulate HTTP header or something very very light (code, metadata etc.). So for calling some backend layer (querying DynamoDB in this case) we need a Lambda@Edge function, which is much complete.
career360guru 👍 1 Selected: D
Option D
TheCloudGuruu 👍 4 Selected: D
D. Lambda@Edge
kejam 👍 5 Selected: D
https://aws.amazon.com/blogs/networking-and-content-delivery/leveraging-external-data-in-lambdaedge/ https://aws.amazon.com/blogs/networking-and-content-delivery/lambdaedge-design-best-practices/

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Option D pairs DynamoDB global tables (low-latency multi-Region data) with CloudFront and a Lambda@Edge function that performs the barcode validation and the write to mark the barcode used. Lambda@Edge can run full Lambda logic including DynamoDB writes at the edge, and Route 53 maps api.example.com to the distribution. This yields the lowest global latency.

Why the Other Options Are Wrong

Option C uses CloudFront Functions, which are restricted to lightweight request/response manipulation and cannot execute the database write logic. Options A and B use Aurora Global Database, which adds cross-Region replication lag for writes and more operational overhead than DynamoDB global tables for this simple key/value marker.

Community Comment Notes

HunkyBunky (likes 6) explains CloudFront Functions only manipulate request data while Lambda@Edge can do anything, including the DB write. alexis123456 argues for A, but Aurora Global adds write latency versus DynamoDB global tables.

Official Reference

Related Analysis

Practice All SAP-C02 Questions

Access 85 questions with complete answers and detailed explanations.

View Full SAP-C02 Practice Test →

← Back to SAP-C02 Study Guide