ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 336 - Professional Data Engineer discussion

Report
Export

You are using BigQuery with a regional dataset that includes a table with the daily sales volumes. This table is updated multiple times per day. You need to protect your sales table in case of regional failures with a recovery point objective (RPO) of less than 24 hours, while keeping costs to a minimum. What should you do?

A.
Schedule a daily BigQuery snapshot of the table.
Answers
A.
Schedule a daily BigQuery snapshot of the table.
B.
Schedule a daily export of the table to a Cloud Storage dual or multi-region bucket.
Answers
B.
Schedule a daily export of the table to a Cloud Storage dual or multi-region bucket.
C.
Schedule a daily copy of the dataset to a backup region.
Answers
C.
Schedule a daily copy of the dataset to a backup region.
D.
Modify ETL job to load the data into both the current and another backup region.
Answers
D.
Modify ETL job to load the data into both the current and another backup region.
Suggested answer: A

Explanation:

To apply complex business logic on a JSON response using Python's standard library within a Workflow, invoking a Cloud Function is the most efficient and straightforward approach. Here's why option A is the best choice:

Cloud Functions:

Cloud Functions provide a lightweight, serverless execution environment for running code in response to events. They support Python and can easily integrate with Workflows.

This approach ensures simplicity and speed of execution, as Cloud Functions can be invoked directly from a Workflow and handle the complex logic required.

Flexibility and Simplicity:

Using Cloud Functions allows you to leverage Python's extensive standard library and ecosystem, making it easier to implement and maintain the complex business logic.

Cloud Functions abstract the underlying infrastructure, allowing you to focus on the application logic without worrying about server management.

Performance:

Cloud Functions are optimized for fast execution and can handle the processing of the JSON response efficiently.

They are designed to scale automatically based on demand, ensuring that your workflow remains performant.

Steps to Implement:

Write the Cloud Function:

Develop a Cloud Function in Python that processes the JSON response and applies the necessary business logic.

Deploy the function to Google Cloud.

Invoke Cloud Function from Workflow:

Modify your Workflow to call the Cloud Function using an HTTP request or Google Cloud Function connector.

steps:

- callCloudFunction:

call: http.post

args:

url: https://REGION-PROJECT_ID.cloudfunctions.net/FUNCTION_NAME

body:

key: value

Process Results:

Handle the response from the Cloud Function and proceed with the next steps in the Workflow, such as loading data into BigQuery.

Google Cloud Functions Documentation

Using Workflows with Cloud Functions

Workflows Standard Library

asked 18/09/2024
Petros Kapouleas
46 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first