You maintain ETL pipelines. You notice that a streaming pipeline running on Dataflow is taking a long time to process incoming data, which causes output delays. You also noticed that the pipeline graph was automatically optimized by Dataflow and merged into one step. You want to identify where the potential bottleneck is occurring. What should you do?
Correct Answer: A
When Dataflow fuses multiple transformations into a single stage (step), it can make it harder to pinpoint which specific part of that fused stage is causing a bottleneck because internal metrics for individual ParDos within the fused stage might not be as distinct. * Reshuffle Operation (Option D):Inserting a Reshuffle (or GroupByKey followed by ungrouping, which forces a shuffle) operation between logical processing steps in your Beam pipeline prevents Dataflow from fusing those steps. A shuffle operation acts as a barrier to fusion. This materializes the intermediate PCollection and forces data to be redistributed across workers. * Benefit for Debugging:By breaking the fusion, the Dataflow monitoring UI will display distinct steps for the operations before and after the Reshuffle. This allows you to observe metrics like processing time, throughput, and watermarks for each now-separated step, making it much easier to identify which part of your original fused logic is the bottleneck. Let's analyze why other options are less effective for this specific problem of afused step: * A (Verify service account permissions):While important for overall pipeline health, permission issues usually result in outright failures or errors in logs, not typically a slowdown within a successfully running (albeit slow) fused step. * B (Insert output sinks):Adding actual output sinks (like writing to Pub/Sub or GCS) after each key step would also break fusion and allow you to measure throughput. However, it's a more heavyweight approach than Reshuffle. It introduces I/O overhead and requires setting up and managing these temporary sinks. Reshuffle is a lighter-weight way to achieve the same goal of breaking fusion for diagnostic purposes within the pipeline itself. * C (Log debug information):Logging can be helpful, but if the entire fused step is slow, logs might not easily distinguish which internal operation is the culprit without very careful and verbose logging. Analyzing potentially massive volumes of logs for performance bottlenecks can be less direct than observing stage metrics in the Dataflow UI once fusion is broken. Using Reshuffle is a standard technique recommended by Google Cloud for debugging performance issues in fused Dataflow stages. Reference: Google Cloud Documentation: Dataflow > Troubleshooting Dataflow pipelines > Common Dataflow errors and troubleshooting steps > Pipeline is slow or stuck. "Break transform fusion: Certain transforms in your pipeline might be fused together into a single stage for optimization. If a particular fused stage is causing a bottleneck, you can temporarily add Reshuffle transforms between the fused transforms to break them into smaller, separate stages. This allows you to get more visibility into the performance of each individual transform and isolate the bottleneck." Apache Beam Documentation: Programming Guide > Pipeline I/O > Reshuffle."Reshuffle can be used to prevent fusion, and ensure that data is materialized and redistributed." (While the primary purpose of Reshuffle is often related to data distribution and freshness, a side effect and common use case is to break fusion for monitoring and debugging).
Question 277
You operate an IoT pipeline built around Apache Kafka that normally receives around 5000 messages per second. You want to use Google Cloud Platform to create an alert as soon as the moving average over 1 hour drops below 4000 messages per second. What should you do?
Correct Answer: A
Question 278
Your chemical company needs to manually check documentation for customer order. You use a pull subscription in Pub/Sub so that sales agents get details from the order. You must ensure that you do not process orders twice with different sales agents and that you do not add more complexity to this workflow. What should you do?
Correct Answer: C
Pub/Sub exactly-once delivery is a feature that guarantees that subscriptions do not receive duplicate deliveries of messages based on a Pub/Sub-defined unique message ID. This feature is only supported by the pull subscription type, which is what you are using in this scenario. By enabling exactly-once delivery, you can ensure that each order is processed only once by a sales agent, and that no order is lost or duplicated. This also simplifies your workflow, as you do not need to create a separate database or subscription to monitor the pending or processed messages. References: * Exactly-once delivery | Cloud Pub/Sub Documentation * Cloud Pub/Sub Exactly-once Delivery feature is now Generally Available (GA)
Question 279
You are implementing security best practices on your data pipeline. Currently, you are manually executing jobs as the Project Owner. You want to automate these jobs by taking nightly batch files containing non- public information from Google Cloud Storage, processing them with a Spark Scala job on a Google Cloud Dataproc cluster, and depositing the results into Google BigQuery. How should you securely run this workload?