Which solution will meet these requirements?
Activate DynamoDB Streams on the DynamoDB table. Create an AWS Lambda trigger for the DynamoDB stream that will post events about user deletion in an Amazon Simple Queue Service (Amazon SQS) queue. Configure each microservice to poll the queue and delete the user from the DynamoDB table.
Set up DynamoDB event notifications on the DynamoDB table. Create an Amazon Simple Notification Service (Amazon SNS) topic as a target for the DynamoDB event notification. Configure each microservice to subscribe to the SNS topic and to delete the user from the DynamoDB table.
Configure the central user service to post an event on a custom Amazon EventBridge event bus when the company deletes a user. Create an EventBridge rule for each microservice to match the user deletion event pattern and invoke logic in the microservice to delete the user from the DynamoDB table.
Configure the central user service to post a message on an Amazon Simple Queue Service (Amazon SQS) queue when the company deletes a user. Configure each microservice to create an event filter on the SQS queue and to delete the user from the DynamoDB table.
Explanations:
While DynamoDB Streams can capture changes to the table and trigger a Lambda function, the solution involves using Amazon SQS for polling. This approach may lead to delays and may not guarantee immediate consistency for data deletion across microservices. Each microservice polling the queue could also lead to inefficiencies.
DynamoDB event notifications with SNS can inform subscribers of changes, but there is no guarantee that the subscribers will process the deletion event immediately or in real-time. Additionally, the method does not ensure immediate deletion from all microservices as there could be delays in event delivery and processing.
Posting an event on an EventBridge event bus allows for real-time event handling. Each microservice can have a rule that matches the user deletion event pattern and triggers the logic to delete the user from their local storage immediately. This ensures that all microservices respond promptly to the deletion request.
Using SQS for message queuing involves creating an event filter, which may introduce latency in processing deletion events. Microservices will need to poll the queue for messages, which can result in delayed responses and may not guarantee immediate deletion across all services.