Question

Difficulty: HardStream Processing and Event Routing with Amazon Kinesis and EventBridge

A developer is designing a real-time transaction processing pipeline. The architecture uses Amazon Kinesis Data Streams to ingest high-volume transaction records from retail merchants, followed by an AWS Lambda function that processes the stream and publishes suspicious transactions to an Amazon EventBridge custom event bus for fraud detection. The Lambda function is deployed inside a private VPC subnet to securely query a database.

During peak sales events, the developer notices two issues:
1. The producer application receives ProvisionedThroughputExceededException errors on the Kinesis stream, even though the total throughput is well below the stream's aggregate limits. The records are currently partitioned using the MerchantID.
2. The Lambda function frequently runs into execution timeouts when attempting to publish events to the EventBridge bus, failing to forward the fraud alerts.

Which two changes should the developer make to resolve these issues?

  1. Update the producer to use a composite partition key by appending a high-entropy transaction identifier to the MerchantID.Answer
  2. Create an interface VPC endpoint (AWS PrivateLink) for EventBridge in the VPC and ensure the Lambda security group allows outbound traffic to it.Answer
  3. C
    Use a static partition key for all incoming transaction records to ensure sequential order of processing across all shards.
  4. D
    Configure a NAT Gateway in the private VPC subnet and update the route table of the same subnet to route 0.0.0.0/0 traffic through it.
  5. E
    Increase the execution timeout of the Lambda function to 15 minutes to handle the increased API response times from EventBridge.

Answer

Updating the producer to use a composite partition key by appending a high-entropy transaction identifier to the MerchantID, and creating an interface VPC endpoint for EventBridge in the VPC.
Updating the producer to use a composite key by appending a high-entropy transaction identifier to the merchant identifier ensures that write operations are evenly distributed across all available Kinesis shards. This prevents hot shards when a single merchant has a transaction spike. Additionally, creating an interface VPC endpoint for EventBridge allows the Lambda function in the private subnet to securely communicate with the EventBridge service privately over the AWS network, resolving the connection timeout issues.

Step-by-Step Solution

1
Analyze the Kinesis streaming issue where some shards are throttled while total stream throughput is low.
Identify that using MerchantID as the partition key causes uneven distribution (hot shards) when a merchant has a high volume of transactions.
To resolve hot shards, the partition key must have high entropy, which can be achieved by using a composite key.
2
Analyze the Lambda timeout issue when attempting to write to EventBridge.
Identify that the Lambda function is in a private VPC subnet and lacks a route to public AWS endpoints like EventBridge.
To establish connectivity, the VPC requires either a NAT Gateway in a public subnet or an interface VPC endpoint for EventBridge in the private subnet.
3
Select the options that correctly implement these solutions.
The composite partition key implementation and the interface VPC endpoint configuration satisfy both requirements securely and correctly.
These actions resolve the performance bottleneck on Kinesis and the networking boundary issue for VPC-bound Lambda.

Key Concept

Stream partition key design and private VPC networking for AWS Lambda integrations.
Estimated Time:3m 0s
Rate this question