Tüm alıştırma soruları

1542 soru

Soru 421Soru

A developer is building a vehicle fleet tracking application that stores telemetry data in an Amazon DynamoDB table. The table is configured with a partition key of `VehicleIDVehicleID` and a sort key of `TimestampTimestamp`. The application needs to support two access patterns: retrieving the history of a specific vehicle within a given time range, and retrieving telemetry records matching a specific `SpeedSpeed` across the entire fleet of vehicles. Some partitions are experiencing throttling due to high-frequency read requests.

Which two actions should the developer take to implement these queries efficiently and resolve the throttling issue?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Create a Global Secondary Index (GSI) with a partition key of `SpeedSpeed` to query speeding violations across all vehicles.; Use the `Query` API operation on the base table with a key condition expression specifying the `VehicleIDVehicleID` and a range condition on the `TimestampTimestamp`.

Cevap

Create a Global Secondary Index (GSI) with a partition key of speed, and use the Query API operation on the base table with a key condition expression specifying the vehicle identifier and a range condition on the timestamp.
The correct approach involves using the Query API operation on the base table to retrieve a vehicle's history because it targets a single partition key and filters by the sort key range efficiently. Additionally, to retrieve records by speed across all vehicles, a Global Secondary Index (GSI) must be created with speed as the partition key, which allows executing Query operations rather than scanning the entire table.

Adım Adım Çözüm

1
Analyze the access pattern for retrieving the telemetry records for a specific vehicle over a time range.
Since the base table partition key is the vehicle identifier and the sort key is the timestamp, using the Query operation with a key condition expression on both keys retrieves the desired data efficiently.
The Query operation operates directly on a single partition key, avoiding full table scans.
2
Analyze the access pattern for retrieving telemetry records matching a specific speed across all vehicles.
Since the partition key of the base table is the vehicle identifier, querying across all vehicles requires a Global Secondary Index (GSI) with speed as the partition key.
A GSI allows querying across all partitions of the base table using a new partition key.
3
Address the partition throttling issue caused by high-frequency read requests.
Throttling on specific keys cannot be resolved simply by increasing overall table capacity; utilizing a GSI can distribute the read workload or caching can be implemented.
Provisioned capacity is distributed across partitions, so hot partition issues require key design or indexing strategies rather than just increasing overall RCUs.

Anahtar Kavram

DynamoDB querying and indexing strategies using Query operations and Global Secondary Indexes (GSIs) to optimize performance and prevent hot partitions.
Soru 422Soru

A developer is implementing a news publishing application that stores article metadata in an Amazon DynamoDB table. The base table uses `ArticleID` as the partition key and `Category` as the sort key. The application needs to frequently retrieve all articles written by a specific author, sorted by their publication date, to display on the author's biography page. The author's identifier is stored in an attribute named `AuthorID`, and the publication date is stored in `PublishDate`.

Which approach should the developer implement to retrieve this data in the most cost-effective and performant manner?

Cevabı ve açıklamayı göster

Cevap: Create a Global Secondary Index (GSI) with AuthorID as the partition key and PublishDate as the sort key, then use the Query API operation on the GSI.

Cevap

Create a Global Secondary Index (GSI) with AuthorID as the partition key and PublishDate as the sort key, then use the Query API operation on the GSI.
Creating a Global Secondary Index (GSI) with AuthorID as the partition key and PublishDate as the sort key enables the application to perform highly efficient Query operations. Since a Query operation only reads the items that match the specified partition key value, this approach minimizes Read Capacity Unit (RCU) consumption and retrieval latency.

Adım Adım Çözüm

1
Analyze the access pattern and base table schema.
The application needs to search by AuthorID (which is not the partition key of the base table) and sort by PublishDate (which is not the sort key of the base table).
This shows that querying the base table directly using the primary keys is not possible for this access pattern.
2
Select the appropriate DynamoDB indexing strategy to support the access pattern.
Create a Global Secondary Index (GSI) where the partition key is AuthorID and the sort key is PublishDate.
A GSI allows querying across the entire table using a partition key and sort key that are different from the base table's primary keys.
3
Choose the most efficient API call for retrieving the data from the index.
Use the Query API operation on the GSI specifying the AuthorID in the key condition expression.
The Query operation only consumes Read Capacity Units (RCUs) for the items actually returned, making it highly efficient compared to scanning the entire table.

Anahtar Kavram

Efficient data retrieval in DynamoDB using Global Secondary Indexes (GSIs) and the Query API operation to avoid expensive Scan operations.
Soru 423Soru

A developer is building a high-throughput IoT monitoring application that writes status updates to an Amazon DynamoDB table. The table's partition key is DeviceId (String) and the sort key is Timestamp (Number). During peak times, the application receives a ProvisionedThroughputExceededException during write operations. Amazon CloudWatch metrics show that the overall write capacity consumed by the table is well below the provisioned Write Capacity Units (WCUs), but a few specific devices are writing data at an extremely high frequency. Which two actions should the developer take to resolve this issue and handle the write failures? (Choose two.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Construct a synthetic partition key by appending a calculated hash or random suffix to the DeviceId to distribute writes across multiple partitions.; Implement exponential backoff and retries in the AWS SDK configuration to handle the write failures gracefully.

Cevap

Construct a synthetic partition key by appending a calculated hash or random suffix to the DeviceId to distribute writes, and implement exponential backoff and retries in the AWS SDK configuration to handle the write failures gracefully.
The correct options recommend creating a synthetic partition key to distribute hot key writes across multiple partitions and implementing exponential backoff to handle transient write exceptions gracefully.

Adım Adım Çözüm

1
Analyze the cause of the ProvisionedThroughputExceededException.
Identify that a few specific devices (hot keys) are exceeding the single partition write limit of 10001000 write capacity units, even though overall table capacity is sufficient.
This confirms a hot partition issue rather than a table-level capacity shortage.
2
Distribute the write load by modifying the partition key design.
Implement a synthetic partition key strategy where a suffix is added to the DeviceId.
This spreads writes for the same DeviceId across multiple physical partitions, bypassing the single-partition limit.
3
Configure client-side error handling.
Enable exponential backoff and retries in the AWS SDK client initialization.
This handles transient errors gracefully, allowing retried requests to succeed when capacity becomes available.

Anahtar Kavram

Handling DynamoDB hot partitions and transient write throttling through partition key design and client-side retry strategies.
Soru 424Soru

An enterprise application requires a backend component to process payment transactions. A software engineer is designing an AWS Lambda function that must connect to a PostgreSQL database hosted inside a private VPC subnet, and also make HTTPS requests to an external payment processor's public API endpoint. Which configuration should the software engineer implement to meet these requirements?

Cevabı ve açıklamayı göster

Cevap: Configure the Lambda function to run in the private subnets of the VPC, and route outbound internet traffic through a NAT Gateway placed in a public subnet.

Cevap

Configure the Lambda function to run in the private subnets of the VPC, and route outbound internet traffic through a NAT Gateway placed in a public subnet.
To access both a private VPC resource (the database) and a public API, the Lambda function must be associated with the private subnets of the VPC. Since Lambda functions inside a VPC are not assigned public IP addresses, they cannot communicate directly with the internet via an Internet Gateway. Instead, outbound internet traffic must be routed from the private subnets to a NAT Gateway situated in a public subnet of the VPC.

Adım Adım Çözüm

1
Determine the networking requirements of the Lambda function.
The Lambda function needs to access a private database (requires VPC access) and a public API (requires internet access).
Understanding the dual requirements (VPC and Internet access) is critical to selecting the correct network configuration.
2
Evaluate the placement of the Lambda function.
The Lambda function must be placed inside the private subnets of the VPC to securely connect to the database.
Placing resources in the same VPC allows network interface creation and secure internal routing.
3
Determine how to enable internet access for VPC-bound resources.
Configure a NAT Gateway in a public subnet of the VPC, and update the private subnet's route table to direct 0.0.0.0/0 traffic to the NAT Gateway.
Lambda functions in a VPC do not get public IPs and cannot use an Internet Gateway directly; they require a NAT Gateway for outbound internet access.

Anahtar Kavram

VPC Networking for AWS Lambda
Soru 425Soru

A developer is building a smart home application that records temperature readings from IoT sensors. The data is stored in an Amazon DynamoDB table where the partition key is `SensorID` and the sort key is `Timestamp`. The developer needs to retrieve all readings for a specific `SensorID` where the recorded temperature is greater than 2525. Which approach is the most efficient and cost-effective way to retrieve this data?

Cevabı ve açıklamayı göster

Cevap: Perform a Query operation specifying the SensorID in the KeyConditionExpression, and use a FilterExpression to return only the items where the temperature is greater than 25.

Cevap

Perform a Query operation specifying the SensorID in the KeyConditionExpression, and use a FilterExpression to return only the items where the temperature is greater than 25.
The Query operation is the most efficient and cost-effective method to retrieve items that share a common partition key. By specifying the partition key (SensorID) in the KeyConditionExpression, DynamoDB directly accesses the partition containing the target items. The FilterExpression is then applied to the non-key temperature attribute to filter the results before they are returned to the application, minimizing payload size.

Adım Adım Çözüm

1
Identify the key schema of the DynamoDB table.
The partition key is SensorID and the sort key is Timestamp.
Knowing the primary keys allows us to target queries to specific partition keys rather than scanning the table.
2
Select the correct operation for retrieving items under a specific partition key.
Use the Query operation rather than the Scan operation.
Query searches only the items matching the partition key, consuming far fewer Read Capacity Units (RCUs) than Scan.
3
Determine how to apply the condition on the non-key temperature attribute.
Apply a FilterExpression for the temperature attribute.
Since temperature is not part of the primary key, it cannot be included in the KeyConditionExpression, but must be filtered using a FilterExpression.

Anahtar Kavram

Using the Query operation with a KeyConditionExpression for the partition key and a FilterExpression for non-key attributes is the most efficient retrieval method in DynamoDB.
Soru 426Soru

A developer is designing an event-driven integration where transaction events from an external order processing service are sent to a custom Amazon EventBridge event bus. The developer creates an EventBridge rule to route these events to an Amazon Kinesis Data Stream for real-time analytics. Each event is a JSON payload that includes `transaction_id`, `store_id`, and `amount`. To support analytics requirements, events must be distributed evenly across the stream's shards, and events with the same `transaction_id` must be processed in the exact order they were received.

Which target configuration should the developer specify in the EventBridge rule to meet these requirements?

Cevabı ve açıklamayı göster

Cevap: Set the target to the Kinesis Data Stream and configure the Partition Key Path to `$.detail.transaction_id`.

Cevap

Set the target to the Kinesis Data Stream and configure the Partition Key Path to `$.detail.transaction_id`.
The correct configuration is to set the EventBridge rule target to the Kinesis Data Stream and configure the Partition Key Path to use the transaction identifier field. This dynamically extracts the high-entropy transaction ID from the payload, ensuring even shard utilization while maintaining ordered delivery for any single transaction.

Adım Adım Çözüm

1
Analyze the requirements for ordered processing and even distribution across Kinesis shards.
Identify that events with the same transaction identifier must go to the same shard to maintain order, and the partition key must have high entropy to distribute the load.
Kinesis routes records to shards based on the hash of their partition keys; identical keys map to the same shard, while diverse keys distribute data evenly.
2
Configure the target settings for the Amazon EventBridge rule that forwards events to Kinesis.
Use the Partition Key Path setting to extract `$.detail.transaction_id` dynamically from the incoming event payload.
This allows EventBridge to dynamically assign the transaction ID as the partition key for each record sent to Kinesis.

Anahtar Kavram

Partitioning in Amazon Kinesis Data Streams via Amazon EventBridge target settings using high-entropy JSON paths.
Soru 427Soru

A developer is designing a corporate training portal that tracks student progress using an Amazon DynamoDB table. The base table key schema consists of UserIDUserID as the partition key and CourseIDCourseID as the sort key. The application must support two primary query patterns: retrieving all courses completed by a specific user within a specified date range sorted by completion date, and retrieving all users who have completed a specific course. Which two strategies should the developer implement to meet these requirements with the most efficient database operations?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Create a Local Secondary Index (LSI) with UserIDUserID as the partition key and CompletionDateCompletionDate as the sort key.; Create a Global Secondary Index (GSI) with CourseIDCourseID as the partition key and UserIDUserID as the sort key.

Cevap

Create a Local Secondary Index (LSI) with UserID as the partition key and CompletionDate as the sort key, and create a Global Secondary Index (GSI) with CourseID as the partition key and UserID as the sort key.
To support retrieving all courses completed by a specific user within a date range, the developer should create a Local Secondary Index (LSI) with the user ID as the partition key and the completion date as the sort key. This enables key-based Query operations with sorting on the date. To find all users who completed a specific course, a Global Secondary Index (GSI) with the course ID as the partition key is required because queries must look up records using an attribute other than the base table's partition key.

Adım Adım Çözüm

1
Analyze the first query pattern: retrieving courses completed by a specific user within a date range.
Since the partition key of the query is the same as the base table (UserIDUserID), but a different sort key (CompletionDateCompletionDate) is required to filter and sort the results, a Local Secondary Index (LSI) is the optimal configuration.
An LSI allows defining a new sort key for queries on the same partition key as the base table.
2
Analyze the second query pattern: retrieving all users who completed a specific course.
Because the query must filter by CourseIDCourseID across all users (which is not the partition key of the base table), a Global Secondary Index (GSI) with CourseIDCourseID as the partition key is needed.
GSIs allow queries across all partitions by defining a different partition key.
3
Verify and eliminate inefficient and insecure options.
Scan operations are ruled out due to high resource usage and latency, and hardcoded credentials in the SDK client creation are eliminated as a severe security anti-pattern.
Query operations on indexes should always be preferred over Scan operations for specific lookups, and authentication must use IAM roles via the default credential provider chain.

Anahtar Kavram

DynamoDB Secondary Indexes (LSI vs GSI) and Query Optimization
Soru 428Soru

An agricultural technology company deploys IoT weather stations that report atmospheric measurements. The data is processed through an Amazon EventBridge custom event bus and must be ingested into an Amazon Kinesis Data Stream for real-time wind speed anomaly analysis. The developer must configure the system to ensure EventBridge can route events directly to Kinesis while preventing write throttling at the Kinesis shard level. Which TWO configuration steps should the developer perform to route these events successfully and maintain optimal ingestion performance?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Create an IAM role with a trust policy that allows the events.amazonaws.com service principal to assume the role, and attach a permissions policy that grants kinesis:PutRecords access to the target Kinesis Data Stream.; Configure the EventBridge target for the Kinesis Data Stream with a custom PartitionKeyPath pointing to a high-entropy field in the event payload, such as $.detail.station_id.

Cevap

To route events successfully and maintain performance, the developer must create an IAM role that allows the EventBridge service to assume it and write to Kinesis, and configure the Kinesis target in EventBridge with a high-entropy PartitionKeyPath using a field like the station ID.
The correct configurations involve setting up proper IAM trust and permissions, and choosing an appropriate partition key strategy. First, EventBridge must be authorized to write to Kinesis. This requires creating an IAM role that EventBridge (events.amazonaws.com) can assume via its trust policy, with permission to perform the kinesis:PutRecords action on the target stream. Second, to prevent write throttling and ensure even distribution of records across Kinesis shards, the developer should configure the EventBridge target with a custom PartitionKeyPath referencing a high-entropy attribute (like the weather station identifier $.detail.station_id) from the incoming event payload.

Adım Adım Çözüm

1
Evaluate the routing path and required IAM permissions.
Identify that EventBridge needs to call the Kinesis PutRecords API, which requires an IAM role with a trust policy allowing events.amazonaws.com and a permissions policy allowing kinesis:PutRecords.
Without the correct trust and permissions policy, EventBridge cannot assume the role to deliver events to Kinesis.
2
Evaluate the sharding and write throughput characteristics of Kinesis Data Streams.
Determine that a high-entropy partition key, such as $.detail.station_id, is necessary to evenly distribute records across all available shards.
A low-entropy or static partition key routes all data to a single shard, causing a hot shard and resulting in throughput limitations and throttling errors.
3
Assess alternate designs, such as using an intermediary Lambda function in a private VPC subnet.
Recognize that a Lambda function inside a private subnet without internet routing (NAT Gateway or VPC Endpoint) cannot connect to public Kinesis endpoints.
Lambda requires a path to the internet or an interface VPC endpoint to reach public AWS service APIs.

Anahtar Kavram

Direct event routing from Amazon EventBridge to Amazon Kinesis Data Streams requires both correct IAM authorization for the publisher and high-entropy partition keys to avoid partition throttling.
Tahmini Süre:2m 0s
Soru 429Soru

A collaborative document editing platform processes real-time change events using an Amazon Kinesis Data Stream with 8 shards. The event payload includes `document_id` (a UUID), `user_id` (a UUID), `event_type` (e.g., `edit_text`, `update_style`, `document_deleted`), and `payload_size`. Currently, the producer application uses `event_type` as the partition key. During peak usage hours, write operations to the stream frequently fail with a `ProvisionedThroughputExceededException` even though the overall data rate is well below the stream's total limit. Additionally, the development team needs to route only the `document_deleted` events to an administrative Amazon SNS topic for compliance auditing. Which TWO actions should the developer take to resolve the throttling issue and route the compliance events?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Change the partition key on the producer to use the `document_id` instead of the `event_type`.; Configure an Amazon EventBridge pipe with the Kinesis Data Stream as the source, specify a filter pattern matching the `document_deleted` event type, and set the Amazon SNS topic as the target.

Cevap

Change the partition key on the producer to use the document ID instead of the event type, and configure an Amazon EventBridge pipe with the Kinesis Data Stream as the source, defining a filter pattern for the deleted event type with the Amazon SNS topic as the target.
Using the document identifier as the partition key ensures high entropy and distributes write requests evenly across all shards, resolving the ProvisionedThroughputExceededException throttling caused by the hot shards when using a low-entropy key like the event type. Amazon EventBridge Pipes provides a direct, serverless way to consume records from a Kinesis Data Stream, filter them based on the event payload (specifically matching the deleted event type), and route them to targets like Amazon SNS without the need to write and manage custom consumer code.

Adım Adım Çözüm

1
Analyze the cause of Kinesis write throttling.
The current partition key is the event type, which has low cardinality (few unique values). This results in uneven data distribution across shards, creating 'hot shards' that throttle writes.
Identifying that the low-entropy partition key is causing the ProvisionedThroughputExceededException.
2
Select a high-entropy partition key.
Using the document ID as the partition key distributes write operations uniformly across all shards while preserving ordering for updates to the same document.
A partition key with high cardinality ensures balanced shard utilization and prevents hot shards.
3
Determine the routing mechanism for compliance events.
Use Amazon EventBridge Pipes to consume events directly from the Kinesis stream, apply a filter pattern to match only the deleted events, and route them to the SNS topic.
EventBridge Pipes offers a low-latency, codeless integration pattern to filter and route stream records to AWS targets.

Anahtar Kavram

Selecting high-entropy partition keys for Kinesis Data Streams and filtering event streams using Amazon EventBridge Pipes.
Soru 430Soru

A developer is building a workflow management application that tracks task history in an Amazon DynamoDB table. The table has TaskId\text{TaskId} as the partition key and UpdateTimestamp\text{UpdateTimestamp} as the sort key. The application needs to retrieve the single most recent update for a specific task to display on a dashboard. Which DynamoDB API configuration should the developer use to retrieve this item with the lowest latency and minimal Read Capacity Unit (RCU) consumption?

Cevabı ve açıklamayı göster

Cevap: Invoke the Query API with a key condition expression for the TaskId\text{TaskId}, set the ScanIndexForward\text{ScanIndexForward} parameter to false, and set the Limit\text{Limit} parameter to 11.

Cevap

Invoke the Query API with a key condition expression for the partition key, set ScanIndexForward to false, and set the Limit parameter to 1.
To retrieve the latest item under a specific partition key in a table with a composite primary key, the most efficient method is to perform a `Query` operation. By specifying the partition key in the key condition expression, setting `ScanIndexForward` to `false` (which reverses the sort key order to descending), and setting `Limit` to 11, DynamoDB only reads and returns the single most recent item. This minimizes the read capacity units (RCUs) consumed.

Adım Adım Çözüm

1
Analyze the table schema and data retrieval requirements.
The table has a composite primary key consisting of a partition key (TaskId) and a sort key (UpdateTimestamp). We need to find the latest record for a specific TaskId.
Since the sort key is a timestamp, DynamoDB naturally stores items for the same partition key sorted by this timestamp.
2
Select the correct operation API.
Choose the Query API instead of GetItem or Scan.
GetItem requires both partition and sort keys, which is impossible since the exact timestamp is unknown. Scan reads the entire table, which is highly inefficient.
3
Optimize the Query operation parameters.
Apply a key condition expression for the TaskId, set ScanIndexForward to false to sort in descending order (latest first), and set Limit to 1.
This instructs DynamoDB to scan only the single latest item under that partition key, minimizing latency and RCU consumption to the absolute minimum.

Anahtar Kavram

Optimizing read operations on composite keys using the DynamoDB Query API with ScanIndexForward and Limit
Tahmini Süre:1m 30s
Soru 431Soru

A developer is optimization-tuning an e-commerce order processing system. The order data is stored in an Amazon DynamoDB table where the primary key consists of OrderIdOrderId (partition key) and OrderDateOrderDate (sort key). The application frequently retrieves all orders placed by a specific user within a given date range. Currently, the application retrieves this data by performing a Scan operation with a FilterExpression on the UserIdUserId and OrderDateOrderDate attributes, which has caused high latency and read capacity exhaustion. Which two actions should the developer take to resolve these issues? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Create a Global Secondary Index (GSI) with UserId as the partition key and OrderDate as the sort key.; Configure the application to perform Query operations against the newly created Global Secondary Index using UserId as the key condition.

Cevap

Create a Global Secondary Index (GSI) with UserId as the partition key and OrderDate as the sort key, and configure the application to perform Query operations against the GSI using UserId as the key condition.
The correct approach involves creating a Global Secondary Index (GSI) that designates the search attribute as the partition key and the range attribute as the sort key, and then updating the application to run targeted Query operations on this index. This eliminates the need to scan the entire base table, reducing both latency and Read Capacity Unit (RCU) consumption.

Adım Adım Çözüm

1
Analyze the access pattern to determine the partition and sort keys needed for target data retrieval.
Identified that the application needs to retrieve items by UserId (which is currently a non-key attribute) and filter/sort by OrderDate.
Designing secondary indexes requires mapping the access pattern requirements to secondary partition and sort keys.
2
Define and create a Global Secondary Index (GSI) on the DynamoDB table.
A GSI is created with UserId as the partition key and OrderDate as the sort key.
A GSI allows queries on non-key attributes from the base table, establishing a new partition structure for efficient lookups.
3
Update the application code to replace the Scan operation with a Query operation against the GSI.
The application issues a Query request with KeyConditionExpression specifying the UserId and KeyConditions for the OrderDate range.
Using Query instead of Scan limits the operation to the target partition, minimizing both read latency and RCU consumption.

Anahtar Kavram

Optimizing DynamoDB data retrieval by replacing table scans with targeted queries on a Global Secondary Index (GSI).
Soru 432Soru

A retail application publishes clickstream events to a custom Amazon EventBridge event bus. A developer needs to route a subset of these events (where the `event_type` is either `add_to_cart` or `checkout`) to an Amazon Kinesis Data Stream for real-time analytics. The event payload includes `session_id` (a UUID v4), `user_id`, and `event_type`. The Kinesis Data Stream has 12 shards. Which configuration should the developer implement to route the correct events while ensuring even data distribution across all stream shards?

Cevabı ve açıklamayı göster

Cevap: Configure an EventBridge rule with the event pattern `{"detail": {"event_type": ["add_to_cart", "checkout"]}}`. Set the target as the Kinesis Data Stream, and configure the partition key path to use `$.detail.session_id`.

Cevap

Configure an EventBridge rule filtering for the specific event types and route them to Kinesis using the session ID as the partition key.
The correct configuration uses EventBridge's declarative event filtering to only route the matching event types, and uses the high-entropy session ID as the partition key to ensure uniform shard distribution.

Adım Adım Çözüm

1
Analyze the EventBridge routing filter pattern.
Only events with `event_type` matching `add_to_cart` or `checkout` should be routed.
This filters the traffic at the event bus level before reaching the target stream.
2
Evaluate the partition key strategy for Kinesis Data Stream shards.
Use `.detail.sessionidinsteadof.detail.session_id` instead of `.detail.event_type`.
The Kinesis partition key dictates shard assignment. A UUID-based key provides high entropy and uniform distribution across the 12 shards, whereas a low-entropy key like event type will bottle-neck traffic onto a maximum of two shards.

Anahtar Kavram

Selecting high-entropy partition keys for Kinesis Data Streams and setting EventBridge event pattern filters.
Soru 433Soru

An energy utility company is designing a real-time data ingestion system to monitor millions of smart meters. The telemetry data must be ingested into an Amazon Kinesis Data Stream and distributed evenly across all shards to prevent write throttling. Additionally, if the downstream consumer (running on AWS Lambda) detects consumption anomalies, it must route these anomaly events to a custom Amazon EventBridge event bus. Which two actions should the developer take to meet these requirements? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Use a compound partition key consisting of the smart meter ID and the current timestamp when publishing records to the Kinesis Data Stream.; Grant the consumer Lambda function IAM permissions for the events:PutEvents action, and configure it to publish anomaly events to the custom EventBridge event bus.

Cevap

Use a compound partition key consisting of the smart meter ID and the current timestamp when publishing records to the Kinesis Data Stream, and grant the consumer Lambda function IAM permissions for the events:PutEvents action, and configure it to publish anomaly events to the custom EventBridge event bus.
To ensure uniform shard utilization in Kinesis Data Streams, producers must use a high-entropy partition key. A combination of the smart meter ID and the current timestamp represents a highly unique key that will be hashed uniformly across all available shards. To route downstream anomalies, the consumer Lambda function requires an IAM execution role containing the events:PutEvents permission to successfully publish event JSON payloads to the custom EventBridge event bus.

Adım Adım Çözüm

1
Select a high-entropy partition key design for the Kinesis Data Stream producer to ensure even data distribution.
The compound key (smart meter ID + timestamp) ensures data is evenly distributed across all shards, minimizing the risk of hot shards.
This directly prevents ProvisionedThroughputExceededException under heavy load.
2
Ensure the downstream Lambda consumer has proper network access and identity permissions to call EventBridge.
The Lambda function is granted the events:PutEvents action in its IAM execution role and has internet or VPC endpoint access to communicate with EventBridge.
This allows the consumer to publish detected anomalies to the custom event bus without network timeouts or authorization errors.

Anahtar Kavram

Even distribution of data in Kinesis streams using high-entropy partition keys, and standard IAM authorization for EventBridge ingestion.
Soru 434Soru

A delivery dispatch service tracks the real-time coordinates of delivery couriers. The couriers' mobile applications publish location updates to an Amazon Kinesis Data Stream. The payload contains a courier ID (a UUID), a region code (such as 'US-EAST' or 'US-WEST'), and a timestamp. An AWS Lambda function processes these updates. During high-traffic events, the producer application receives ProvisionedThroughputExceededException errors when writing to the stream, even though the total stream throughput is well below its provisioned limits. The developer discovers that some shards are heavily loaded while others are underutilized. Which configuration change should the developer make to resolve this write throttling issue?

Cevabı ve açıklamayı göster

Cevap: Configure the producer application to use the courier ID as the partition key when putting records into the stream.

Cevap

Configure the producer application to use the courier ID as the partition key when putting records into the stream.
Using the high-entropy courier ID (UUID) as the partition key distributes write requests uniformly across all shards. Since Amazon Kinesis maps partition keys to shards using an MD5 hash, high-entropy keys ensure even utilization of shards and prevent ProvisionedThroughputExceededException errors during writes.

Adım Adım Çözüm

1
Analyze the cause of the ProvisionedThroughputExceededException errors on the producer application.
The errors occur during write operations (putting records) despite the total stream throughput being below the provisioned limits, which indicates uneven partition key distribution causing hot shards.
To identify why write throttling occurs at the shard level rather than the stream level.
2
Evaluate the entropy of the available attributes (courier ID and region code) to determine their suitability as partition keys.
The courier ID (UUID) is a high-entropy key with many unique values, whereas the region code (e.g., 'US-EAST') has low entropy with very few unique values.
Kinesis distributes data across shards using a hash of the partition key, meaning high-entropy keys distribute data more evenly.
3
Select the configuration that ensures even distribution across all shards.
Using the courier ID as the partition key ensures write requests are distributed uniformly across all shards, resolving the write throttling issue.
To utilize the full provisioned capacity of the stream and eliminate hot shards.

Anahtar Kavram

Kinesis Partition Key Selection and Hot Shards
Tahmini Süre:1m 30s
Soru 435Soru

A developer is implementing a hotel reservation tracking system that stores reservation details in an Amazon DynamoDB table. The base table uses ReservationIDReservationID as the partition key and CheckInDateCheckInDate (formatted as YYYY-MM-DD) as the sort key. The application frequently needs to retrieve all reservations for a specific hotel location (stored in the HotelLocationHotelLocation attribute) within a given date range. Which strategy should the developer implement to meet these requirements with the lowest latency and the most efficient Read Capacity Unit (RCU) consumption?

Cevabı ve açıklamayı göster

Cevap: Create a Global Secondary Index (GSI) with HotelLocationHotelLocation as the partition key and CheckInDateCheckInDate as the sort key, and perform a Query operation on the GSI.

Cevap

Create a Global Secondary Index (GSI) with HotelLocation as the partition key and CheckInDate as the sort key, and perform a Query operation on the GSI.
Creating a Global Secondary Index (GSI) with the hotel location as the partition key and check-in date as the sort key allows the application to perform highly efficient Query operations. The Query operation only reads the items that match the key condition expression, minimizing latency and RCU consumption.

Adım Adım Çözüm

1
Analyze the query requirements against the primary key structure of the base table.
The query needs to filter by HotelLocation, which is not the partition key (ReservationID) of the base table. A Query operation cannot be performed on the base table directly.
DynamoDB Query operations require an equality condition on the partition key.
2
Define an indexing strategy to support the query requirements.
Identify that a Global Secondary Index (GSI) with HotelLocation as the partition key and CheckInDate as the sort key is required.
GSIs allow querying data across the entire table using a partition key and sort key that differ from those of the base table.
3
Choose the optimal data retrieval operation.
Perform a Query operation on the GSI using the key condition expression for HotelLocation and a range condition for CheckInDate.
Query operations only read the items that match the key condition, resulting in predictable, low latency and highly efficient RCU consumption compared to full table scans.

Anahtar Kavram

Optimizing data retrieval in DynamoDB using Global Secondary Indexes (GSIs) and Query operations instead of Scan operations.
Tahmini Süre:1m 30s
Soru 436Soru

An online auction platform uses an Amazon Kinesis Data Stream to process real-time bidding events. The data stream has 16 shards, and an AWS Lambda function is configured to process the incoming records. Each bidding event payload includes a unique `bidder_id`, an `auction_id` (representing one of thousands of active auctions), a `category` (representing one of 8 major item categories), and a `bid_amount`. During a high-profile auction event, developers observe frequent `ProvisionedThroughputExceededException` errors, and cloud watch metrics show that only a small number of shards are receiving traffic. The current partition key is set to the `category` field. Which partition key design should the developer implement to resolve the throttling and distribute the load evenly across all shards?

Cevabı ve açıklamayı göster

Cevap: Configure the partition key to use the `auction_id` field to ensure a high-entropy key that distributes records uniformly across all shards.

Cevap

Configure the partition key to use the auction identifier field to ensure a high-entropy key that distributes records uniformly across all shards.
The correct choice is to configure the partition key to use the auction identifier field. Kinesis Data Streams distributes incoming records across shards using an MD5 hash of the partition key. Choosing a high-entropy key with thousands of distinct values ensures a uniform distribution of records, preventing hot shards and resolving the ProvisionedThroughputExceededException errors.

Adım Adım Çözüm

1
Diagnose the cause of the ProvisionedThroughputExceededException errors and the uneven shard usage.
The current partition key is category, which only has 8 distinct values. Since there are 16 shards, at least half of the shards will receive no data based on this key, and popular categories will cause hot shards.
Identifying the mismatch between key cardinality and shard count explains the resource bottleneck.
2
Select a high-entropy field from the event payload to serve as the new partition key.
The auction identifier has thousands of unique active values.
A high-entropy key ensures that the MD5 hashing algorithm distributes the data uniformly across all 16 shards.
3
Modify the producer application to utilize the selected high-entropy field.
The workload is balanced across all shards, eliminating the hot shard issue and resolving the throttling errors.
Applying the high-entropy key on the producer side is the standard pattern to resolve partition key hot spots in Kinesis.

Anahtar Kavram

Partition Key Entropy in Amazon Kinesis Data Streams
Tahmini Süre:1m 30s
Soru 437Soru

A developer is maintaining a multiplayer online game that stores player state in an Amazon DynamoDB table. The table primary key consists of a partition key Region (e.g., 'US-East', 'EU-West') and a sort key PlayerID. During a peak tournament, players in the 'US-East' region experience latency and receive ProvisionedThroughputExceededException errors. CloudWatch metrics indicate that the table's overall consumed write capacity is well below the provisioned limit. Which action should the developer take to resolve this issue and prevent it from recurring?

Cevabı ve açıklamayı göster

Cevap: Redesign the primary key to use a partition key with higher cardinality, such as a combination of Region and a hashed suffix of PlayerID, to distribute write requests evenly across partitions.

Cevap

Redesign the primary key to use a partition key with higher cardinality, such as a combination of Region and a hashed suffix of PlayerID, to distribute write requests evenly across partitions.
Redesigning the primary key with higher cardinality (e.g., sharding/salting) distributes requests across multiple physical partitions, which prevents exceeding the 1,000 WCU limit on any single partition.

Adım Adım Çözüm

1
Analyze the exception and metrics
Identify that the ProvisionedThroughputExceededException occurs even though the overall consumed capacity is below the limit, indicating a partition hotspot.
DynamoDB partitions have individual throughput limits (1,000 WCUs and 3,000 RCUs). If a single partition key receives traffic exceeding this limit, throttling occurs regardless of overall table settings.
2
Evaluate schema design
Determine that using 'Region' as a partition key leads to low cardinality, as many players will share the same region, creating a hot partition.
Good partition key design requires high cardinality to distribute read and write operations uniformly across all available partitions.
3
Implement write sharding (salting)
Add a random or hashed suffix to the partition key (e.g., 'US-East-1', 'US-East-2') to distribute the load across multiple physical partitions.
This strategy, known as write sharding or salting, ensures that writes to a single region are spread across different partitions, avoiding the 1,000 WCU per-partition limit.

Anahtar Kavram

DynamoDB partition key design and sharding to avoid hot partitions
Soru 438Soru

A developer is designing an integration where transactional events from an order management system are published to an Amazon EventBridge custom event bus. The developer must route only 'OrderCompleted' events with a 'total_value' greater than $500 to an Amazon Kinesis Data Stream for real-time analysis. The Kinesis stream has multiple shards, and events belonging to the same customer must be processed in order by the same shard.

Which TWO configurations should the developer implement to meet these requirements?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Define an EventBridge event pattern that filters for the 'OrderCompleted' detail-type and uses a numeric comparison to check that the 'total_value' is greater than 500.; Configure the EventBridge rule's Kinesis Data Stream target to use a Partition Key Path that references the customer ID field in the event payload.

Cevap

Define an EventBridge event pattern that filters for 'OrderCompleted' and a 'total_value' greater than 500, and configure the EventBridge rule's target to use a Partition Key Path referencing the customer ID field.
To meet the requirements, the developer must filter events and ensure ordering. Filtering is achieved by configuring an EventBridge event pattern matching the 'OrderCompleted' detail-type and checking that the total value is greater than 500 using a numeric comparison. Ordering per customer is achieved by routing events to the Kinesis stream with a partition key derived from the customer ID. Setting the Partition Key Path on the EventBridge Kinesis target ensures EventBridge extracts the customer ID dynamically from each event payload, routing all events for a given customer to the same shard in sequence.

Adım Adım Çözüm

1
Analyze the event filtering requirements.
An EventBridge event pattern needs to match the 'detail-type' value of 'OrderCompleted' and apply a numeric comparison filter where the 'total_value' is greater than 500.
This filters matching events at the source before they are routed to the target, minimizing unnecessary processing.
2
Determine the partition key strategy for Kinesis Data Streams.
Configure the Partition Key Path on the Kinesis target using a JSON path (e.g., $.detail.customer_id).
Kinesis routes records to shards based on the hash of the partition key. To ensure sequential ordering per customer, events must share the same partition key and thus go to the same shard.

Anahtar Kavram

Routing events from Amazon EventBridge to Amazon Kinesis Data Streams requires configuring event patterns for filtering and specifying a partition key path to distribute data across shards while preserving order.
Soru 439Soru

A multiplayer gaming application streams real-time player action events to an Amazon Kinesis Data Stream. An AWS Lambda function processes these events to update a live leaderboards database. During peak tournaments, the game server logs show ProvisionedThroughputExceededException errors when writing to the stream, and the Lambda consumer experiences frequent timeouts while processing the event batches. Which TWO actions should the developer take to resolve these issues?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Modify the producer to use a high-entropy partition key, such as a combination of player ID and session ID, instead of a static game room ID.; Increase the Lambda function's timeout configuration to accommodate the batch processing time and reduce the batch size or maximum batching window if necessary.

Cevap

The developer should modify the producer to use a high-entropy partition key (such as a combination of player ID and session ID) and increase the Lambda function's timeout configuration while reducing the batch size or maximum batching window if necessary.
Using a high-entropy partition key like a combination of player ID and session ID distributes the write throughput evenly across all shards, avoiding hotspots. Additionally, increasing the Lambda timeout ensures the function has sufficient time to process event batches before AWS Lambda terminates the execution context.

Adım Adım Çözüm

1
Analyze the Kinesis throughput exception.
Identify that the ProvisionedThroughputExceededException is occurring due to uneven distribution of data across shards (hot shards) caused by using low-entropy keys like a game room ID.
Choosing a high-entropy partition key like player ID and session ID ensures even hash distribution across all shards.
2
Analyze the Lambda timeout failures.
Determine that the processing time for the batch is exceeding the configured Lambda timeout.
Increasing the Lambda timeout allows the function to complete processing, and tuning batch size limits the number of events processed at once to prevent timeouts.

Anahtar Kavram

Handling throttling and timeouts when processing Amazon Kinesis streams with AWS Lambda
Soru 440Soru

A developer is optimizing data access for a multiplayer mobile game. The player data is stored in an Amazon DynamoDB table with `GameID` as the partition key and `PlayerID` as the sort key. The table includes attributes for `HighScore` and `RegistrationDate`. The developer needs to implement two new requirements:

1. Retrieve the top 10 players for a specific game, sorted by `HighScore` from highest to lowest.
2. Retrieve the profiles of 50 specific players across various games using a single network request.

Which combination of actions should the developer take to meet these requirements efficiently? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Create a Global Secondary Index (GSI) with `GameID` as the partition key and `HighScore` as the sort key, and query the GSI with `ScanIndexForward` set to `false`.; Use the `BatchGetItem` API operation to retrieve the 50 player profiles.

Cevap

Create a Global Secondary Index (GSI) with the game identifier as the partition key and the high score as the sort key, query it with the sorting parameter set to false, and use the batch get operation to fetch multiple player profiles.
To retrieve sorted high scores, a Global Secondary Index (GSI) with the game identifier as the partition key and high score as the sort key must be created, and then queried with the scan index direction reversed. To retrieve multiple distinct items across partitions in a single network request, the batch get operation is the most efficient and standard API call.

Adım Adım Çözüm

1
Analyze the sorting and retrieval requirement for the top 10 players.
Identify that a Global Secondary Index (GSI) with GameID as the partition key and HighScore as the sort key is needed because the base table's sort key is PlayerID, which does not allow sorting by HighScore.
DynamoDB queries can only sort results by the table's or index's sort key.
2
Determine the query configuration for descending sort order.
Query the GSI with ScanIndexForward set to false.
By default, ScanIndexForward is true (ascending). Setting it to false returns results in descending order.
3
Analyze the requirement to retrieve 50 profiles across different games in a single network request.
Select the BatchGetItem API operation.
BatchGetItem allows retrieving up to 100 items from one or more tables using their primary keys in a single network call.

Anahtar Kavram

DynamoDB Index design and batch operations
ÖncekiSayfa 22 / 78Sonraki
Tüm alıştırma soruları — AWS Certified Developer - Associate | Examkin