A data pipeline is a set of steps that move and process data from one place to another, often automatically and continuously, like a water pipe moving water from a source to a destination.
Click to reveal answer
beginner
What is the 'batch processing' pattern in data pipelines?
Batch processing collects data over time and processes it all at once, like baking a big batch of cookies instead of one at a time.
Click to reveal answer
beginner
Explain the 'streaming processing' pattern in data pipelines.
Streaming processing handles data continuously as it arrives, like a conveyor belt where items are processed one by one without waiting.
Click to reveal answer
intermediate
What is the role of Google Cloud Pub/Sub in data pipelines?
Google Cloud Pub/Sub acts like a message bus that moves data messages between services quickly and reliably, supporting streaming data pipelines.
Click to reveal answer
intermediate
Why use Dataflow in a data pipeline?
Dataflow runs data processing tasks that can handle both batch and streaming data, automatically scaling and managing resources so you don't have to worry about the details.
Click to reveal answer
Which data pipeline pattern processes data in real-time as it arrives?
AStreaming processing
BBatch processing
CManual processing
DArchival processing
✗ Incorrect
Streaming processing handles data continuously as it arrives, enabling real-time data handling.
What GCP service is best for messaging between components in a streaming pipeline?
ACloud Storage
BBigQuery
CCloud Pub/Sub
DCloud SQL
✗ Incorrect
Cloud Pub/Sub is designed for messaging and event delivery in streaming pipelines.
Which service can handle both batch and streaming data processing in GCP?
ADataflow
BCloud Functions
CCloud Run
DCloud Spanner
✗ Incorrect
Dataflow supports unified batch and streaming data processing.
Batch processing is best described as:
AProcessing data one piece at a time immediately
BIgnoring data until manually triggered
CProcessing data only during business hours
DCollecting data and processing it all at once
✗ Incorrect
Batch processing collects data over time and processes it together.
Which pattern would you choose for a pipeline that needs to analyze sensor data instantly?
ABatch processing
BStreaming processing
CArchival processing
DManual processing
✗ Incorrect
Streaming processing is suitable for instant analysis of continuous data like sensor data.
Describe the main differences between batch and streaming data pipeline patterns.
Think about how and when data is processed.
You got /4 concepts.
Explain how Google Cloud services like Pub/Sub and Dataflow work together in a streaming data pipeline.
Consider messaging and processing roles.
You got /4 concepts.
Practice
(1/5)
1. Which Google Cloud service is best suited for real-time messaging in a data pipeline?
easy
A. Cloud Storage
B. BigQuery
C. Pub/Sub
D. Cloud Functions
Solution
Step 1: Understand real-time messaging needs
Real-time messaging requires a service that can quickly send and receive messages between components.
Step 2: Identify Google Cloud services for messaging
Pub/Sub is designed for real-time messaging, while BigQuery is for analytics, Cloud Storage for file storage, and Cloud Functions for event-driven compute.
Final Answer:
Pub/Sub -> Option C
Quick Check:
Real-time messaging = Pub/Sub [OK]
Hint: Real-time messaging in GCP? Think Pub/Sub first [OK]
Common Mistakes:
Confusing BigQuery as a messaging service
Choosing Cloud Storage for streaming data
Selecting Cloud Functions instead of messaging service
2. Which of the following is the correct syntax to create a Dataflow pipeline in Python using Apache Beam?
A. Data will be stored in Cloud Storage instead of BigQuery
B. Data from Pub/Sub messages decoded and stored in BigQuery table
C. Pipeline will fail due to missing schema in WriteToBigQuery
D. Raw Pub/Sub messages stored as bytes in BigQuery
Solution
Step 1: Analyze pipeline steps
The pipeline reads messages from Pub/Sub, decodes bytes to strings, then writes to BigQuery.
Step 2: Understand output behavior
Since messages are decoded before writing, the data stored in BigQuery will be the decoded string form.
Final Answer:
Data from Pub/Sub messages decoded and stored in BigQuery table -> Option B
Quick Check:
Decoded Pub/Sub data written to BigQuery = Data from Pub/Sub messages decoded and stored in BigQuery table [OK]
Hint: Decoded Pub/Sub data goes to BigQuery if WriteToBigQuery used [OK]
Common Mistakes:
Assuming raw bytes are stored without decoding
Thinking pipeline fails without explicit schema (default schema can be inferred)
Confusing output destination as Cloud Storage
4. You have a Dataflow pipeline that reads from Pub/Sub but fails with a permission error. What is the most likely cause?
medium
A. The Pub/Sub topic does not exist
B. BigQuery dataset is not created
C. The Dataflow pipeline code has syntax errors
D. The service account running Dataflow lacks Pub/Sub Subscriber role
Solution
Step 1: Identify permission error context
Permission errors usually mean the service account lacks rights to access a resource.
Step 2: Match error to resource
Since the pipeline reads from Pub/Sub, the service account needs the Subscriber role on the Pub/Sub topic.
Final Answer:
The service account running Dataflow lacks Pub/Sub Subscriber role -> Option D
Quick Check:
Permission error reading Pub/Sub = missing Subscriber role [OK]
Hint: Permission errors often mean missing roles on resources [OK]
Common Mistakes:
Assuming syntax errors cause permission errors
Thinking topic absence causes permission errors
Confusing BigQuery dataset issues with Pub/Sub permissions
5. You want to build a data pipeline that ingests streaming IoT sensor data, processes it in real-time, and stores aggregated results hourly in BigQuery. Which pattern best fits this use case?
hard
A. Use Pub/Sub for ingestion, Dataflow streaming for processing with windowing, then write to BigQuery
B. Use Cloud Storage for ingestion, batch Dataflow jobs for processing, then write to BigQuery
C. Use BigQuery streaming inserts directly from IoT devices
D. Use Cloud Functions triggered by Cloud Storage uploads to process data
Solution
Step 1: Identify streaming ingestion and processing needs
IoT sensor data is streaming and requires real-time processing with time-based aggregation.
Use Pub/Sub for ingestion, Dataflow streaming for processing with windowing, then write to BigQuery -> Option A
Quick Check:
Streaming ingestion + windowed processing + BigQuery = Use Pub/Sub for ingestion, Dataflow streaming for processing with windowing, then write to BigQuery [OK]