Prepare and test your skills

Prepare and test your skills

Evaluating relational and non-relational database services means comparing how they store data, enforce schema, and scale to pick the right storage for a workload. Relational services use tables with enforced schemas and full SQL for online transaction processing (OLTP). Non-relational services use flexible, schemaless models that scale automatically for large, distributed workloads.
Relational database services on Google Cloud are fully managed services that set up, maintain, and administer databases built from tables, rows, and columns. Cloud SQL (opens in a new tab) delivers fully managed MySQL, PostgreSQL, and SQL Server databases and is valued for openness, ease of use, security, cost-efficiency, and Google Cloud integration. The Enterprise Plus edition for PostgreSQL and MySQL provides a 99.99% availability service-level agreement (SLA) with near-zero downtime maintenance, optimized hardware and software configurations, intelligent data caching for read-intensive transactional workloads, a configurable data cache option, and 35 days of log retention.
Spanner is a mission-critical, global-scale database service that keeps transactional data strongly consistent across regions. Spanner supports GoogleSQL, an ANSI-compliant SQL dialect, with query statements that scan tables and return rows, data definition language statements that create tables, views, and roles, data manipulation language statements that insert, update, and delete data, data access control statements for table and column privileges, and transaction control statements for managing data modifications. AlloyDB for PostgreSQL is a fully managed, PostgreSQL-compatible database for demanding transactional workloads, while AlloyDB Omni is a downloadable edition that runs in a data center, on a laptop, at the edge, and in any cloud.
Relational services protect transactional systems with backups, replication, and recovery flows. Cloud SQL supports automated backups with binary logging for point-in-time recovery to a fresh instance, high availability configuration, and cross-region replicas for zonal or regional failure. Spanner databases can be exported in full through Dataflow templates to Avro files in a Cloud Storage bucket and re-imported into a new Spanner database, and the Dataflow connector can copy data between Spanner and Cloud Storage for controlled backups.
Non-relational database services on Google Cloud store schemaless data that scales automatically without fixed tables. Firestore (opens in a new tab) is the successor to Datastore and provides a highly scalable NoSQL document database built for automatic scaling, high performance, and ease of application development. Firestore in Datastore mode preserves Datastore capabilities for legacy App Engine applications, while new document-oriented applications use Firestore APIs for more advanced capabilities. Firestore runs in Google data centers with redundancy and automatic encryption at rest, and Google handles administration with no planned downtime.
Firestore provides managed durability and consistency without requiring a fixed table schema:
Firestore data uses a different object model from relational tables, where a kind maps to a table, an entity or document maps to a row, a property or field maps to a column, and a key or document ID maps to a primary key. Unlike rows in a relational table, entities of the same kind can have different properties, and the same property name can hold different value types, so Firestore is schemaless and does not require a consistent set of properties. Because all queries are served by previously built indexes, Firestore does not support join operations, inequality filtering on multiple properties, or filtering based on results of a subquery, and reads scale with the size of the result set rather than the size of the dataset.
Bigtable is a NoSQL option for data that is not highly structured and for workloads that do not require ACID transactions. Bigtable can replicate a dataset asynchronously across zones within a Google Cloud region to support availability. Tables can be saved and exported as Hadoop sequence files to Cloud Storage and then imported back into another Bigtable instance for backup and restore.
Choosing between relational and non-relational storage depends on schema flexibility, query needs, global scalability, and transactional consistency. Relational services enforce a schema and support full SQL with joins and subqueries for OLTP, while Firestore trades those advanced queries for schemaless flexibility and queries that scale with the result set. Spanner combines SQL with global scale and transaction control, while Bigtable fits massive non-transactional data that does not need ACID guarantees:
| Service | Data model | Choose when |
|---|---|---|
| Cloud SQL | Managed MySQL, PostgreSQL, SQL Server tables | The workload needs full SQL support for OLTP with backups, high availability, and cross-region replicas |
| Spanner | Global-scale relational tables with GoogleSQL | The application needs mission-critical relational data with global scale and managed transactions |
| AlloyDB for PostgreSQL | PostgreSQL-compatible relational tables | The workload is demanding and transactional and needs PostgreSQL compatibility with high performance |
| Firestore | Schemaless NoSQL documents and entities | The application needs automatic scaling, strong consistency, and flexible properties for catalogs and user profiles |
| Bigtable | NoSQL for less-structured data | The data is not highly structured or the workload does not require ACID transactions |
The right choice follows the workload shape because each service optimizes a different tradeoff between structure and scale. A retail catalog or user-profile system with changing fields flows well to Firestore, while a banking ledger with strict tables and joins belongs on Cloud SQL, AlloyDB for PostgreSQL, or Spanner. Analytical queries over large datasets belong on BigQuery, and large immutable blobs such as images or movies belong on Cloud Storage.
Exam tip: Choose Cloud SQL when the requirement states full SQL support for OLTP, choose Firestore when the requirement states automatic scaling with a schemaless model, and choose Bigtable when the requirement states no ACID transactions are needed or data is not highly structured.
Data warehousing and processing architectures on Google Cloud separate messaging, processing, and analytics into services that connect in order. Messaging services receive events from applications and databases without waiting for processing to finish. Processing services transform streaming and batch data in flight, and the data warehouse stores the result for SQL analysis downstream.
BigQuery (opens in a new tab) is the data warehouse destination for large-scale analytics using SQL. In an extract, load, transform (ELT) pipeline, data is first loaded into BigQuery and then transformed with SQL so downstream tools can consume it. Existing warehouses such as Teradata and Amazon Redshift can be refactored to BigQuery, and open source Hadoop and Spark jobs can write directly to BigQuery through the BigQuery connector. Because BigQuery separates storage from analysis, many pipelines can land data in one place for centralized querying.
The BigQuery Data Transfer Service replaces manual extract and load work with scheduled, managed loads into BigQuery. It automates recurring movement on a schedule rather than requiring custom jobs for each source. Supported sources named in the documentation include:
Once data lands in BigQuery, transformation happens with SQL, views, routines, and DataFrames, while exports and copies move results to Cloud Storage or other tables when needed.
Dataflow is the managed service for running data processing pipelines built with the Apache Beam software development kits (SDKs). The same Dataflow model handles both continuous streaming data and finite batch data, so one pipeline definition can read, transform, and write without managing servers. Pipelines can be defined with the Beam SDKs for Java, Python, or Go, built as Flex Templates, assembled in the job builder UI, or started from prebuilt templates. This flexibility supports use cases from ecommerce streaming pipelines to GPU image processing and streaming large language model inference with the Beam RunInference API.
A common streaming pattern connects messaging to warehousing through Dataflow in order:
Events from source apps and operational databases flow into a Pub/Sub topic, through a Dataflow Beam pipeline for filtering and transformation, into BigQuery tables for near real-time SQL analytics.
The same pattern works with change data: Datastream changes can flow through Dataflow job templates into BigQuery, and MySQL changes can be continuously replicated to a BigQuery table. Choose Dataflow when data must be cleaned, joined, or reshaped between its source and BigQuery.
Pub/Sub and Google Cloud Managed Service for Apache Kafka provide decoupled, asynchronous messaging between producers and consumers. Producers publish events once to a topic, and consumers subscribe independently, so the source system does not wait for processing or storage to complete. This boundary lets ingestion keep running even when downstream jobs scale, restart, or fall behind. Landing raw events first in a bronze tier in Cloud Storage preserves the original data before later cleaning and analysis.
Database ingestion shows how the decoupling works in practice. Operational databases emit change data capture (CDC) change events to a Pub/Sub topic. A Managed Service for Apache Spark (opens in a new tab) job subscribes to that Pub/Sub topic, processes the stream, and applies the changes to the raw datastore in Cloud Storage. From there, transfers or processing jobs can move curated data into BigQuery without placing load directly on the operational database.
How messaging, processing, and warehousing connect is defined by data state and timing, with each layer handing data to the next:
| Service | Role in architecture | Data flow |
|---|---|---|
| Pub/Sub / Managed Service for Apache Kafka | Durable message buffer | Events flow from producers to topics, then to subscribed consumers |
| Dataflow | Stream and batch transformation | Data flows from topics or files through Beam pipeline steps to destinations |
| BigQuery | Central warehouse for SQL analytics | Curated data flows from transfers and pipelines into datasets and tables |
Use messaging when producers and consumers must operate independently, use Dataflow when data needs transformation in motion, and use BigQuery when the goal is scheduled loads plus SQL-based analysis.
Exam tip: Choose a Dataflow template for continuous Pub/Sub to BigQuery streaming, and choose BigQuery Data Transfer Service for scheduled, managed loads from SaaS apps, Cloud Storage, or Amazon S3.
Performance-optimized and in-memory solutions store frequently used data in memory instead of on disk so applications can read it with very low latency and high throughput. Memorystore for Memcached (opens in a new tab) is a highly scalable, fully managed Memcached service on Google Cloud that provides this type of distributed, in-memory key-value store. Google manages the service, so teams can focus on the application without installing or maintaining Memcached.
Low-latency caching with Memorystore uses an in-memory key-value layer in front of a slower primary database. Memorystore for Memcached is built on open source Memcached and is binary and ASCII protocol compliant. Applications connect to it using standard open source Memcached client libraries in any language, which makes it easy to lift and shift existing applications with little to no code changes. Memorystore for Memcached is being deprecated and will shut down on January 31, 2029, and Google recommends migrating workloads to Memorystore for Valkey for superior performance and features.
High-performance, scalable web applications use Memorystore for Memcached to avoid slow database reads on every request. Data flows from the primary database to the cache, and then future reads flow from the cache to the application.
Common caching use cases include:
A Memcached instance represents one Memcached cluster, and it can contain a single node or a collection of nodes. All nodes in an instance must have the same memory per node and the same number of vCPUs. Keys written to the instance are divided across all nodes in the cluster and are not replicated, so loss of a node means loss of the keys stored on that node.
A Memcached node is the fundamental unit of a Memcached instance. Before creating a cluster, you choose the number of nodes, the memory per node, and the number of vCPUs per node based on dataset size, tolerance for key loss, and workload characteristics. Each node has its own IP address and port, and applications can find all node addresses manually or by using the Auto Discovery service.
Deployment planning for Memorystore balances throughput and latency requirements against resource costs. Adding more nodes, more memory per node, and more vCPUs per node increases cache capacity and request-handling ability, but it also increases cost. Because keys are spread across nodes without replication, adding nodes expands total memory while also spreading risk across more separate stores.
Location controls both latency and availability for the cache. The instance is deployed in a single region, and the application accessing it must be deployed in the same region because access from a Google Cloud resource in a different region is not supported. Within that region, nodes can be distributed automatically across zones or placed in specific zones, and automatic distribution is recommended to place nodes optimally. Avoid provisioning all nodes in a single zone to improve fault tolerance for the application.
Exam tip: Deploy the Memorystore instance in the same region as the application, because cross-region access is not supported, and remember that cached keys are divided across nodes with no replication.
Use Cloud SQL when the workload needs full SQL support for online transaction processing (OLTP) with backups, high availability configuration, and cross-region replicas. Choose Firestore when the application needs automatic scaling with a schemaless document model and strong consistency, and choose Bigtable when the data is not highly structured or the workload does not require ACID transactions.
Relational database services use tables with enforced schemas and full SQL with joins and subqueries for online transaction processing (OLTP). Firestore is a schemaless NoSQL document database where entities of the same kind can have different properties, queries are served by previously built indexes without join operations, and reads scale with the size of the result set rather than the size of the dataset.
Source systems publish events to a Pub/Sub topic, a Dataflow job built with the Apache Beam software development kits (SDKs) reads from the topic and applies filtering, mapping, and SQL transformations, and Dataflow delivers the processed rows to BigQuery tables for near real-time analytics. Use messaging when producers and consumers must operate independently, use Dataflow when data needs transformation in motion, and use BigQuery when the goal is SQL-based analysis.
Deploy the Memorystore for Memcached instance in the same region as the application because access from a different region is not supported, and distribute nodes across zones rather than provisioning all nodes in a single zone to improve fault tolerance. Keys written to the instance are divided across all nodes with no replication, so loss of a node means loss of the keys stored on that node.
An organization is designing the backend for a web application to manage user profiles and dynamic product catalogs. The data structure changes frequently, requiring a flexible, schemaless NoSQL data model where entities can store varying attributes. Additionally, the application requires atomic (ACID) transactions and strong consistency for inventory balance operations.
Which Google Cloud database service should the organization select?
BigQuery
Cloud Bigtable
Cloud SQL
Firestore in Datastore mode
Last updated