Streaming Data Pipeline Design with Dataflow and Pub/Sub
Short answer
B Use Dataflow to create a streaming pipeline that reads the data from Pub/Sub, processes the data, and writes it to BigQuery using the streaming API.
Question
Key Takeaways
The main trap is confusing orchestration (Composer) or batch/cluster-based processing (Dataproc) with true serverless stream processing (Dataflow), which is Google's recommended approach for this specific workload.
This question tests the design of a low-latency, high-throughput streaming pipeline using Google Cloud services. The correct solution leverages Dataflow for real-time processing from Pub/Sub to BigQuery.
Common mistake: Candidates often choose Cloud Composer (A) thinking 'orchestration' means 'processing', but Composer only manages jobs; it does not process streams itself. Others may pick Dataproc (C) assuming Spark is always the standard for big data, ignoring the operational complexity and Google's preference for Dataflow in streaming contexts.
Expert Analysis
The scenario requires a streaming data pipeline with low latency and high throughput, specifically involving filtering, enriching, and aggregating real-time player activity from Pub/Sub into BigQuery. Google Cloud's recommended service for serverless, scalable stream processing is Dataflow. Dataflow natively integrates with Pub/Sub via Apache Beam, allowing for efficient windowing, late-data handling, and direct streaming writes to BigQuery using the streaming API.
Option B is correct because Dataflow is designed for this exact pattern: it reads directly from Pub/Sub, performs complex transformations (filtering, enrichment, aggregation) in-memory with high efficiency, and writes to BigQuery. It autoscales automatically to handle throughput spikes common in gaming scenarios.
Option A (Cloud Composer) is incorrect because it is an orchestration tool, not a stream processor. While it can trigger workflows, it does not provide the low-latency, continuous processing required for real-time streaming data; it is better suited for batch or scheduled tasks.
Option C (Dataproc) involves managing Spark clusters. While Spark Structured Streaming can process data from Pub/Sub, it requires significant cluster management overhead and is generally less cost-effective and more complex to operate than the fully managed Dataflow for this specific use case. Google recommends Dataflow over Dataproc for pure streaming analytics unless specific custom Spark libraries are needed.
Option D (Cloud Run functions) is unsuitable for high-throughput streaming due to cold starts, concurrency limits, and the lack of native stateful aggregation capabilities found in stream processing engines like Beam/Dataflow. It is better for event-driven, lightweight tasks rather than continuous high-volume data pipelines.
Exam Strategy
When asked about 'streaming' and 'real-time' processing on Google Cloud, prioritize Dataflow unless there is a specific constraint requiring on-prem integration or custom Spark code. Remember that Composer is for orchestration (scheduling dependencies), not execution. For high-throughput, serverless stream processing, Dataflow is almost always the correct architectural choice over Dataproc due to lower operational overhead and better integration with Pub/Sub.
Frequently Asked Questions
Why not use Cloud Composer for streaming data?
Is Dataproc ever better than Dataflow for streaming?
Discussion 1 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 1
-
Terralogiq 👍 1 Answered BDataflow is Google's recommended approach for streaming pipelines like this case, it's built for exactly this pattern (Pub/Sub → transform/enrich/aggregate → BigQuery), autoscales for high throughput, handles windowing/late data natively, and has built-in Pub/Sub-to-BigQuery streaming templates. A (Composer) is an orchestrator, not a stream processor. C (Dataproc/Spark) adds cluster management overhead and isn't the native/recommended fit on GCP. D (Cloud Run functions) doesn't scale well for continuous high-throughput streaming with stateful processing like aggregation. https://cloud.google.com/dataflow/docs/guides/streaming-pipeline
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All ADP Questions
Access 65 questions with complete answers and detailed explanations.
View Full ADP Practice Test →