professional-cloud-data-engineer
Cloud Composer is a fully managed workflow orchestration service built on the open-source Apache Airflow engine. It executes data pipelines authored in Python as Directed Acyclic Graphs (DAGs), which define the order, dependencies, and logic of tasks. Cloud Composer stores these DAG files in a Cloud Storage bucket and runs them on managed infrastructure, coordinating tasks across other Google Cloud data services.
DAGs use specialized Google Cloud operators to interact with services like Dataproc, Dataflow, BigQuery, and Cloud Storage without writing custom API code. For example, an ephemeral Spark workload uses a sequential operator chain:
Operators can run in deferrable mode, which releases worker resources while waiting for long-running external jobs. Instead of holding a worker slot, the operator pauses and registers a trigger; Cloud Composer resumes the task once the external service signals completion.
Optimizing a Cloud Composer environment involves managing resources and triggers. DAG storage buckets should use multi-region or dual-region configurations for high availability. Pipelines can be scheduled or triggered automatically by events, such as a file arriving in Cloud Storage. These events are often sent via Pub/Sub or Cloud Functions to start a DAG that validates the data before processing.
Exam tip: Running operators in deferrable mode frees up Cloud Composer worker slots while waiting on long external jobs, lowering cluster compute utilization.
Choosing between Google Cloud Workflows and Cloud Composer depends on workload requirements. Cloud Workflows is a serverless, low-latency state machine engine ideal for coordinating microservices and HTTP-based APIs. Cloud Composer, built on Apache Airflow, is designed for complex, dependency-heavy batch data transformations.
| Orchestration Service | Underlying Engine | Latency Profile | Primary Target Workloads |
|---|---|---|---|
| Cloud Composer | Managed Apache Airflow | Batch-oriented | Large-scale data engineering, complex DAG dependencies, scheduled transformations |
| Workflows | Serverless state machine | Low-latency | Microservice orchestration, event-driven API routing, lightweight automation |
Securing Cloud Composer requires applying least-privilege access using Identity and Access Management (IAM). Environments should use custom service accounts with limited roles (like composer.worker) instead of broad project permissions. A Private IP environment ensures all internal communication happens over a private network without public internet exposure. Layered security controls include:
Cloud Composer operates under a Shared Responsibility Model: Google manages the Kubernetes infrastructure, while administrators maintain DAG code and perform Airflow version updates. Operational telemetry is sent to Cloud Logging and Cloud Monitoring. A critical maintenance task is keeping the internal Airflow metadata database under 20 gigabytes by running periodic cleanup DAGs to purge old task history, which prevents scheduler performance degradation.
Exam tip: Cloud Composer metadata databases must be kept under 20 gigabytes through routine maintenance DAGs to prevent scheduler timeouts and performance degradation.
Google Cloud Workflows is a fully managed, serverless orchestration service that coordinates distributed services using state machines defined in YAML or JSON. It scales automatically with demand and requires no cluster management.
Workflows features native connectors for services like Cloud Run, BigQuery, Cloud Functions, and Pub/Sub, handling authentication and API calls automatically. The engine includes declarative retry policies with exponential backoff to manage transient failures and can route failed executions to defined fallback steps.
For event-driven automation, Workflows integrates with Eventarc and Cloud Scheduler. A typical event-driven pipeline follows this sequence:
Exam tip: Google Cloud Workflows scales down to zero when idle and bills based on step transitions and execution duration, making it cost-effective for intermittent, event-driven tasks compared to dedicated Composer environments.
Automated testing validates data pipeline code, SQL scripts, and orchestration workflows before they reach production. Pipelines combine code (e.g., Apache Beam) with SQL scripts for Data Definition Language (DDL) and Data Manipulation Language (DML) operations. Dataform is used to compile SQL, check dependencies, and enforce schema rules. All pipeline assets are stored in a Git repository for version control and rollback capabilities.
Google Cloud Build (Cloud Build) automates testing by triggering on code commits or pull requests. It fetches source code and dependencies from Google Artifact Registry (Artifact Registry), then runs static code analysis and compiles the code. Testing occurs at three levels:
For Google Cloud Composer (Cloud Composer) DAG deployment, a structured pipeline is used:
pytest) in an isolated environment to verify DAG syntax and dependencies.Exam tip: Cloud Build uses separate triggers for presubmit testing and deployment, validating Cloud Composer DAGs in an isolated test environment before synchronizing files to the Cloud Storage bucket.
Infrastructure as Code (IaC) defines and manages cloud resources through declarative configuration files (using tools like HashiCorp Terraform (Terraform) or Google Cloud Infrastructure Manager), making infrastructure reproducible and version-controlled.
Teams use a GitOps workflow where configuration files are stored in Git. Changes are submitted via pull requests and applied automatically by branch-aware Cloud Build pipelines. Infrastructure changes are promoted sequentially across environments:
terraform plan to preview changes without applying them.dev branch triggers terraform apply for the development environment.staging branch deploys to a pre-production environment for integration testing.prod branch passes through approval gates in Google Cloud Deploy (Cloud Deploy) before applying to live production.Terraform stores the state of provisioned infrastructure in a remote state file in a dedicated Cloud Storage bucket. Enabling object versioning on this bucket protects the state file and allows recovery. Isolated remote state files in separate buckets for each environment (dev, staging, prod) prevent changes in one environment from corrupting another.
Exam tip: Terraform remote state must be stored in a dedicated Cloud Storage bucket with object versioning enabled for each separate environment to protect infrastructure state files from corruption and unintended overwrites.
Secure deployment pipelines control artifact storage, enforce permissions, and verify container integrity. Artifact Registry serves as a centralized package manager for container images, Python packages, and other artifacts. Teams configure different repository types for specific needs:
| Repository Type | Primary Purpose | Key Operational Benefit |
|---|---|---|
| Standard repository | Stores private build artifacts and container images | Provides centralized, private package versioning with fine-grained access policies |
| Remote repository | Caches dependencies from external sources like Docker Hub | Reduces download latency and protects against upstream registry downtime |
| Virtual repository | Combines multiple repositories behind a single endpoint | Prioritizes private packages over external ones to prevent dependency confusion attacks |
Google Artifact Analysis (Artifact Analysis) scans container images in Artifact Registry for vulnerabilities, generates a Software Bill of Materials (SBOM), and accepts Vulnerability Exploitability eXchange (VEX) statements. Cloud Build can produce SLSA Level 3 compliant container builds, which include verifiable build provenance metadata about the source code and build toolchain.
Security is enforced by granting service accounts minimum required permissions via IAM. Deployment pipelines should not access raw customer data, and write access is restricted to specific destinations. VPC Service Controls create security perimeters around Cloud Build, Artifact Registry, and target environments. Cloud Deploy automates application delivery to Google Kubernetes Engine (GKE), GKE Enterprise, and Google Cloud Run (Cloud Run), supporting strategies like canary releases to test new versions on a subset of traffic.
Exam tip: Virtual repositories in Artifact Registry protect pipelines from dependency confusion attacks by explicitly defining the search order and prioritizing internal package repositories over public upstream sources.
Prepare and test your skills
Prepare and test your skills
Google Cloud Workflows should be chosen for low-latency microservice orchestration, event-driven API routing, and lightweight automation that can scale down to zero when idle. In contrast, Cloud Composer is built for complex, dependency-heavy batch transformations and large-scale data engineering workflows.
Deferrable mode optimizes resource usage by releasing worker slots while waiting for long-running external jobs, which lowers overall cluster compute utilization. Instead of occupying a worker slot continuously, the operator pauses and registers a trigger until the external service signals completion.
Virtual repositories protect pipelines from dependency confusion attacks by combining multiple repositories behind a single endpoint and explicitly prioritizing internal, private package repositories over external public sources. This configuration ensures that build systems fetch trusted internal packages before searching upstream registries.
Terraform remote state files should be isolated in dedicated Google Cloud Storage (Cloud Storage) buckets for each separate environment to prevent changes in one environment from corrupting another. Each dedicated bucket must also have object versioning enabled to protect infrastructure state files from corruption and unintended overwrites.