PROFESSIONAL-CLOUD-DEVELOPER · Question #356
You are developing a new ecommerce website for your company. You want customers to receive a customized email notification when they place an order. You need to configure this email service while mini
The correct answer is A. Create a Cloud Run function that is triggered by a create type event in Firestore.. A Cloud Run function triggered by a Firestore 'create' event is the ideal serverless, event-driven solution. When a new order document is created in Firestore, the function fires automatically, generates the customized email, and sends it-requiring zero server management and mini
Question
You are developing a new ecommerce website for your company. You want customers to receive a customized email notification when they place an order. You need to configure this email service while minimizing deployment effort. What should you do?
Options
- ACreate a Cloud Run function that is triggered by a create type event in Firestore.
- BCreate an email-sending application hosted on Compute Engine that is invoked by an HTTP
- CCreate an email notification channel, and set up an alerting policy that is based on log metrics
- DUse Pub/Sub to send an email when the orders/ API returns an HTTP response of 200 OK.
How the community answered
(28 responses)- A75% (21)
- B4% (1)
- C14% (4)
- D7% (2)
Explanation
A Cloud Run function triggered by a Firestore 'create' event is the ideal serverless, event-driven solution. When a new order document is created in Firestore, the function fires automatically, generates the customized email, and sends it-requiring zero server management and minimal deployment effort. Option B (Compute Engine + HTTP trigger) requires provisioning and maintaining a VM, which increases operational overhead. Option C (alerting policy + log metrics) is designed for infrastructure monitoring alerts, not transactional customer notifications. Option D (Pub/Sub) could work but requires additional infrastructure to publish messages and a separate consumer, adding complexity compared to the direct Firestore trigger approach.
Topics
Community Discussion
No community discussion yet for this question.