The most operationally efficient solution to provide email notifications and insert a record into a database when a file is put into an S3 bucket is to use S3 event notifications that target an SNS topic with two subscriptions.
Set Up S3 Event Notification:
Open the S3 console and select the bucket.
Navigate to "Properties" -> "Event notifications" -> "Create event notification."
Configure the event to trigger on s3:ObjectCreated:*.
Create an SNS Topic:
Open the SNS console and create a new topic.
Set up two subscriptions for the SNS topic:
One subscription to send the email notification.
Another subscription to invoke an AWS Lambda function that inserts the record into the database.
Lambda Function for Database Insertion:
Create an AWS Lambda function to handle the database insertion.
Configure the function to trigger from the SNS topic.
Configuring S3 Event Notifications
Amazon SNS Subscriptions
Invoking Lambda with SNS