You are processing millions of files in an Oracle Cloud Infrastructure (OCI) Object Storage bucket.
Each time a new file is created, you want to send an email to the customer and create an order in a database.
The solution should perform and minimize cost.
Which action should you use to trigger this email? (Choose the best answer.)
Click on the arrows to vote for the correct answer
A. B. C. D.C.
The best answer to trigger an email each time a new file is created in an OCI Object Storage bucket, while minimizing cost and maximizing performance, is B. Use OCI Events service and OCI Notification service to send an email each time a file is created.
OCI Events service allows you to subscribe to various OCI resources and events, including Object Storage buckets. Whenever a new object is created in the bucket, an event is triggered, which can be consumed by a target service. OCI Notification service allows you to create topics and subscriptions, where the topic represents an endpoint for a notification and the subscription represents a subscription to a topic. A subscription can be configured to receive notifications for a specific event type, such as object creation.
By using OCI Events and Notification services together, you can create a subscription to the event of new objects being created in the Object Storage bucket and configure the subscription to send an email to the customer. This solution is more efficient and cost-effective than scheduling a cron job or an Oracle Function to constantly monitor the bucket for new files.
Option A, scheduling a cron job, can be costly and inefficient as it would require constant monitoring of the bucket, even when no new files are being created. Additionally, it may not be able to handle the scale of millions of files being processed.
Option C, scheduling an Oracle Function to check the bucket every minute, is not as efficient as using OCI Events and Notification services. Checking the bucket every minute can still result in delays in sending the email to the customer and can lead to higher costs as the function will be running constantly.
Option D, scheduling an Oracle Function to check the bucket every second, is even less efficient and can result in unnecessary costs. Checking the bucket every second may not be necessary, as the customer may not need to receive the email notification immediately after the file is created.