Designing data processing systems · Topic 3 of 5
Reliability, Data Quality and ACID Choices
Data preparation with Dataform, Dataflow and Data Fusion, LLM query generation, pipeline monitoring, data validation, disaster recovery and ACID choices.
- 5 min
- Dataform for SQL in BigQuery, Dataflow for code and streaming, Data Fusion for visual low-code.
- LLM-generated SQL is reviewed and dry-run before use.
- Validate with assertions, data quality scans, dead-letter outputs and source-to-target counts.
What it is
Fidelity means the data is correct: cleaned, validated and true to its source. Reliability means the system keeps delivering that data through failures, with the right recovery point and recovery time. The exam asks you to pick tools for preparation and validation, and to trade strong consistency (ACID) against availability and scale.
How it works
Preparing and cleaning data
| Tool | Best for |
|---|---|
| Dataform | SQL transformations inside BigQuery (ELT), managed in Git, with dependencies, incremental tables and assertions |
| Dataflow | Code-based cleaning in Apache Beam, batch or streaming, at any scale |
| Cloud Data Fusion | Visual, low-code pipelines with many connectors; the Wrangler view for interactive cleaning |
| Gemini in BigQuery | Prompting an LLM to generate or explain SQL and suggest preparation steps |
An LLM can draft a query from a plain-language prompt, but the output must be reviewed, tested and run with a dry run first. Treat generated SQL like code from a new colleague: useful, never trusted blindly.
"SQL skills, data already in BigQuery, version control and tests" points to Dataform. "No coding, many sources, visual" points to Cloud Data Fusion. "Streaming or complex logic in code" points to Dataflow.
Data validation
Validate at every boundary: on ingestion, after each transformation and after migration. In Dataform, assertions run after the table is built and fail the workflow when rows break a rule.
config {
type: "table",
assertions: {
uniqueKey: ["order_id"],
nonNull: ["order_id", "customer_id"],
rowConditions: ["amount >= 0"]
}
}
SELECT order_id, customer_id, amount FROM ${ref("stg_orders")}
Other options are Dataplex data quality scans with rules on BigQuery tables, a dead-letter output in Dataflow for records that fail parsing, and row counts and checksums compared between source and target.
Monitoring and orchestration
Cloud Composer or Workflows run steps in order with retries. Cloud Monitoring alerts on pipeline health, for example Dataflow data freshness and system lag or the age of the oldest unacknowledged Pub/Sub message. An alert on data that stops arriving catches silent failures that a job-status alert misses.
Disaster recovery and fault tolerance
Start from the RPO (how much data you may lose) and RTO (how long you may be down).
| Service | Built-in protection | Extra for disaster recovery |
|---|---|---|
| BigQuery | Time travel (2 to 7 days, default 7), then 7 days fail-safe | Table snapshots, cross-region dataset replication, managed disaster recovery (Enterprise Plus) |
| Cloud Storage | Redundant within the location; soft delete; object versioning | Dual-region or multi-region buckets; turbo replication (dual-region only) for a 15 minute RPO target |
| Cloud SQL | High availability: standby in another zone | Cross-region read replica promoted on regional failure |
| Spanner | Synchronous replication; multi-region configs | Backups and point-in-time recovery |
| Bigtable | Replication between clusters | Multi-cluster routing for automatic failover |
| Pub/Sub | Messages retained for replay | Seek to a snapshot or timestamp to reprocess |
ACID compliance versus availability
| Need | Choose |
|---|---|
| Global transactions, strong consistency, horizontal scale | Spanner |
| Regional relational transactions | Cloud SQL or AlloyDB |
| Atomic changes across several BigQuery tables | BigQuery multi-statement transactions |
| Massive writes, single-row atomicity is enough | Bigtable |
Bigtable replication with multi-cluster routing favours availability; reads from another cluster can briefly be stale. Use single-cluster routing when an application needs read-your-writes behaviour.
A worked example
A finance team's nightly load sometimes doubles rows when a step is retried, and the dashboard shows inflated revenue. The engineer makes the load idempotent with a MERGE on the business key and adds a uniqueKey assertion in Dataform. Composer retries the task safely, and a Cloud Monitoring alert fires if the table is not refreshed by 06:00.
How the exam asks about this
- "Analysts transform data in BigQuery with SQL and need tests, dependencies and Git history." Dataform with assertions.
- "Recover a BigQuery table to its state four hours ago after a bad update." Query it with
FOR SYSTEM_TIME AS OFand write the result to a new table, using time travel. - "Inventory updates across regions must never oversell stock." Spanner, for globally consistent transactions.
What to remember for the exam
- Dataform for SQL in BigQuery, Dataflow for code and streaming, Data Fusion for visual low-code.
- LLM-generated SQL is reviewed and dry-run before use.
- Validate with assertions, data quality scans, dead-letter outputs and source-to-target counts.
- BigQuery time travel covers up to 7 days; snapshots and replication go further.
- Spanner gives global ACID; Bigtable gives single-row atomicity with huge scale.
A retry is only safe if the step is idempotent. Append-only loads that are retried create duplicates; use MERGE, partition overwrite or deduplication keys.
Common mistakes
Alerting only on job failure. A job can succeed while loading zero rows; alert on freshness and row counts too.
Treating time travel as a backup. It lasts at most 7 days and stays in the same location; use snapshots or replication for longer or regional protection.
Choosing Bigtable for multi-row transactions. It is atomic only within a single row.
Check yourself
Which tool adds tests, dependencies and Git history to SQL transformations in BigQuery?
Dataform, using SQLX files with assertions such as uniqueKey and nonNull.
How far back can BigQuery time travel go?
Up to 7 days by default, configurable down to 2 days, followed by a 7 day fail-safe period that only Google support can restore from.
Which database gives strongly consistent transactions across regions?
Spanner, with a multi-region instance configuration.
Topic 3 of 5 in Designing data processing systems
Test yourself on Designing data processing systems
The full Google Cloud Professional Data Engineer question bank has 733 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Google Cloud. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.