
Answer-first summary for fast verification
Answer: Call the data processing script from the Cloud Function triggers using Cloud Function events.
**B is correct** because Cloud Functions can be triggered by changes in both Cloud Storage and Firestore, offering a fast, near real-time response. This method simplifies setup and integrates seamlessly with Cloud Storage and Firestore instances, allowing the data processing script to be called directly from Cloud Function triggers upon any change. This ensures efficient, real-time processing with minimal setup and maintenance. **A is incorrect** as it introduces unnecessary complexity and potential latency by redirecting queries to an App Engine application, which is not efficient for real-time processing. **C is incorrect** because manually fetching and analyzing logs requires significant programming effort and is not suitable for real-time processing. **D is incorrect** due to the need for setting up and managing individual triggers for each datastore instance, leading to a complex and difficult-to-maintain setup, especially with multiple instances. For more information, refer to the following links: - [Firestore Events](https://firebase.google.com/docs/functions/firestore-events) - [Cloud Functions Documentation](https://cloud.google.com/functions/docs/calling) - [Cloud Storage Triggers](https://cloud.google.com/functions/docs/calling/storage)
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are developing an application designed to monitor changes in Cloud Storage and Firestore instances. Upon detecting a change, it should immediately trigger an action to verify and process the updated data in near real-time. What is the most efficient method to achieve this with minimal setup?
A
Redirect your data-changing queries to an App Engine application, call the data processing script from the App Engine application.
B
Call the data processing script from the Cloud Function triggers using Cloud Function events.
C
Write a Python script that fetches logs from the datastores, analyzes them, and invokes the required processing code.
D
Invoke the data processing script using the trigger mechanism in each datastore.
No comments yet.