CCNA Pcd Design Scalable Questions

20 of 170 questions · Page 3/3 · Pcd Design Scalable topic · Answers revealed

151
MCQmedium

A company is designing a Cloud Spanner schema for a global user database. They anticipate high write throughput and want to avoid hotspotting on the primary key. Which primary key design strategy is MOST appropriate?

A.Use an auto-incrementing integer as the primary key
B.Use a UUID as the primary key
C.Use a timestamp as the primary key
D.Use a composite key with user_id and timestamp
AnswerB

UUIDs distribute writes evenly across splits, avoiding hotspots.

Why this answer

Using a composite key with a hash prefix or a monotonically increasing value as the first part of the key can cause hotspots. UUIDs distribute writes evenly across splits. Using a UUID as the leading part of a composite key avoids hotspotting better than the other options.

152
MCQhard

You are using Cloud Bigtable to store time-series financial market data. To ensure high availability across zones, you configure cluster replication. What is the recommended replication topology for automatic failover?

A.Two clusters in the same zone
B.Single cluster with multi-node configuration
C.Two clusters in different zones with replication enabled and multi-cluster routing
D.Three clusters in three regions
AnswerC

This setup allows automatic failover if one cluster becomes unavailable.

Why this answer

Bigtable supports replication across clusters in different zones within a region (or across regions). For automatic failover, you should use primary-secondary (also called single-cluster routing with failover) or multi-cluster routing. The recommended HA setup is to have two clusters in different zones with replication enabled.

153
MCQhard

A company uses Memorystore for Redis as a session store. They observe that sessions are evicted before their TTL expires, causing users to be logged out prematurely. Which action should they take?

A.Enable persistence (RDB/AOF)
B.Increase the memory size of the instance
C.Change the eviction policy to volatile-ttl
D.Increase the maxmemory-policy to allkeys-lru
AnswerB

More memory prevents eviction of active sessions.

Why this answer

Memorystore evicts keys when memory is full. Increasing memory size allows more keys to be stored without eviction. Changing eviction policy to 'allkeys-lru' might help but could still evict sessions.

Increasing memory is the direct solution.

154
MCQmedium

A company needs to store petabytes of time-series IoT sensor data and query it with single-digit millisecond latency at millions of reads per second. The data has a simple key-value structure with timestamps. Which Google Cloud database is MOST appropriate?

A.BigQuery
B.Cloud Spanner
C.Firestore
D.Cloud Bigtable
AnswerD

Bigtable is the correct choice: wide-column NoSQL, designed for time-series and IoT workloads, single-digit ms latency, and scales to millions of QPS with additional nodes.

Why this answer

Cloud Bigtable is designed for exactly this use case — petabyte-scale, low-latency (single-digit ms), high-throughput NoSQL storage for time-series, IoT, and financial data. It scales horizontally by adding nodes. BigQuery is optimised for analytics (seconds-to-minutes latency), Cloud SQL is for OLTP (limited to tens of thousands of QPS), and Firestore is for document data with hierarchical structure.

155
Multi-Selectmedium

A company is deploying a microservices application on Google Cloud. They need a database for each service: one for user profiles (relational, high availability), one for product catalog (NoSQL, low latency), and one for session caching. Which THREE services should they use? (Select 3 answers)

Select 3 answers
A.Firestore
B.Cloud Spanner
C.Bigtable
D.Memorystore
E.Cloud SQL
AnswersA, D, E

NoSQL document database with low latency for product catalog.

Why this answer

Cloud SQL for relational user profiles with HA, Firestore for NoSQL product catalog with low latency, Memorystore for session caching.

156
MCQmedium

A gaming company uses Cloud Spanner for its global leaderboard. The leaderboard is updated frequently by millions of users. They notice that write latency spikes during peak hours due to hotspotting on the leaderboard table. Which schema change would best mitigate this?

A.Prefix the primary key with a server ID or hash of the user ID
B.Use UUID as the primary key
C.Add a secondary index on the rank column
D.Enable leaderboard caching with Memorystore
AnswerA

This distributes writes across multiple splits, reducing contention.

Why this answer

Using a composite primary key with a hash prefix (e.g., server_id) as the first part distributes writes across splits, reducing hotspots. A monotonically increasing key (like rank) causes hotspotting.

157
Multi-Selectmedium

You are designing a globally distributed ecommerce platform that uses Cloud Spanner for order processing. The platform needs to support high read throughput with low latency for product catalog queries. Which two features should you use? (Choose TWO.)

Select 2 answers
A.Stale reads with bounded staleness
B.Global secondary indexes
C.Interleaved tables
D.Local secondary indexes
E.Strong reads
AnswersA, D

Stale reads can be served by read-only replicas, improving read throughput and latency for non-critical queries.

Why this answer

Stale reads with bounded staleness (Option A) allow Cloud Spanner to serve read requests from any replica within a configurable time window (e.g., up to 15 seconds), avoiding the latency of contacting the leader replica. This dramatically increases read throughput for product catalog queries where near-real-time data is acceptable. Local secondary indexes (Option D) are co-located with the base table data in the same split, enabling efficient, low-latency queries on attributes within a single region without cross-node coordination.

Exam trap

Cisco often tests the misconception that all secondary indexes are global and that strong reads are always required for consistency, but the trap here is that for high-throughput, low-latency catalog queries, stale reads and local secondary indexes are the correct choices because they avoid leader bottlenecks and cross-split coordination.

158
MCQhard

A financial trading application uses Cloud Spanner for order processing. To reduce latency for read-heavy operations, the team wants to allow stale reads with a bounded staleness of 10 seconds. Which Spanner API or method should they use to achieve this?

A.Set the session to read-only mode
B.Use the `timestamp_bound` parameter with `max_staleness` set to 10 seconds
C.Configure an index with the `STORING` clause to avoid index joins
D.Use mutations API instead of DML for writes
AnswerB

Spanner's API allows setting `max_staleness` for bounded stale reads, reducing latency.

Why this answer

Spanner supports stale reads (bounded staleness) by setting a read timestamp. The read timestamp can be set to a past time within the maximum staleness. The `max_staleness` option in the client libraries or the `read_timestamp` parameter in gRPC API allow bounded staleness.

159
MCQeasy

A development team needs a serverless NoSQL document database for a new mobile application that requires offline synchronization for users. The database should scale automatically and integrate with Firebase Authentication. Which Google Cloud database meets these requirements?

A.Memorystore for Redis
B.Cloud SQL
C.Firestore
D.Cloud Bigtable
AnswerC

Firestore is the correct choice: serverless, document-based, with offline sync and FirebaseAuth integration.

Why this answer

Firestore provides serverless NoSQL document storage, automatic scaling, offline sync, and integration with Firebase Authentication.

160
MCQhard

A DevOps engineer is designing a row key for a Bigtable table storing user activity logs. The pattern is: user_id (UUID) + timestamp. On a cluster with 10 nodes, they observe severe hotspotting on a single node during peak writes. Which row key design change would likely resolve this issue?

A.Use a hash of the user_id as the prefix
B.Use a single table with no row key change
C.Increase the number of nodes to 20
D.Use a composite key: timestamp + user_id
AnswerA, D

Salting with a hash is also a valid technique, but the question expects one answer. Reversing the key is more common and directly addresses the issue. However, since both could be correct, the best answer is A.

Why this answer

Option A is correct because prepending a hash of the user_id distributes writes uniformly across all Bigtable tablets. Bigtable uses the row key prefix to determine tablet assignment; a UUID prefix is random but sequential UUIDs (e.g., time-based) can cluster writes. A hash function (e.g., MD5 or CRC32) ensures even distribution, eliminating hotspotting on a single node.

Exam trap

Cisco often tests the misconception that reversing the key order (timestamp + user_id) improves distribution, but in reality it creates a hotspot on the tablet handling the current timestamp range.

How to eliminate wrong answers

Option B is wrong because keeping the same row key pattern (user_id + timestamp) does not address the hotspotting; if user_ids are sequential or timestamp-heavy, writes still concentrate on one tablet server. Option C is wrong because increasing nodes to 20 does not fix the root cause—hotspotting is a data distribution problem, not a capacity issue; more nodes will still see skewed load if the row key design is poor. Option D is wrong because swapping to timestamp + user_id makes the timestamp the prefix, which causes all writes at the same time to hit the same tablet, worsening hotspotting rather than resolving it.

161
MCQmedium

A team is designing a Cloud Bigtable schema for a time-series application that records sensor readings every second. They need to avoid write hotspots. Which row key design is most appropriate?

A.Use a salted timestamp where salt is the sensor ID modulo a small number
B.Use a composite key with sensor ID followed by reversed timestamp
C.Use a UUID as the row key
D.Use a monotonically increasing timestamp as the row key
AnswerB

Sensor ID spreads data, and reversed timestamp avoids sequential writes to the same tablet.

Why this answer

To avoid hotspots, row keys should be designed to distribute writes across tablets. Reversing the timestamp (e.g., `[timestamp reversed]#[sensor_id]`) spreads new writes across different tablets, rather than appending to the same tablet.

162
MCQmedium

A social media app uses Firestore in Native mode. The app has a feature that shows a user's recent posts. The query sorts by timestamp descending and limits to 10 results. As the user base grows, the queries become slow. Which optimization should you implement FIRST?

A.Increase the Firestore quota for reads
B.Create a composite index on (user_id, timestamp) for the posts collection
C.Use Cloud SQL for this query instead of Firestore
D.Denormalize the user’s recent posts into a subcollection
AnswerB

A composite index on (user_id, timestamp) allows Firestore to efficiently filter by user and order by timestamp.

Why this answer

Option B is correct because the query filters by `user_id` and sorts by `timestamp` descending, which requires a composite index on `(user_id, timestamp DESC)` to avoid a full collection scan. Without this index, Firestone performs a sort in memory, which becomes slow as the dataset grows. Creating the composite index allows Firestore to serve the query directly from the index, dramatically improving performance.

Exam trap

The trap here is that candidates often assume Firestore automatically handles all sorting or that increasing quotas or denormalizing data will fix performance, when in fact the missing composite index is the single most impactful first optimization for this query pattern.

How to eliminate wrong answers

Option A is wrong because increasing the Firestore read quota does not address the root cause of slow queries; it only raises the limit on the number of reads, not the speed of index-based retrieval. Option C is wrong because migrating to Cloud SQL would introduce relational overhead and latency for a simple document-based query, and Firestore is designed for exactly this kind of real-time, sorted query when properly indexed. Option D is wrong because denormalizing recent posts into a subcollection would require maintaining duplicate data and still need an index on `(user_id, timestamp)` within that subcollection; it adds complexity without solving the missing index issue.

163
Multi-Selectmedium

A company wants to migrate an on-premises MySQL database to Cloud SQL with minimal downtime. Which two steps should they take? (Choose two.)

Select 2 answers
A.Use Database Migration Service to create a continuous replication job
B.Set up a Cloud SQL proxy on the source database
C.Take a full backup and restore it to Cloud SQL before replication
D.Configure binary logging on the source MySQL database
E.Disable foreign key checks on the source database
AnswersA, D

DMS supports continuous migration with minimal downtime.

Why this answer

Database Migration Service (DMS) can be used for continuous replication. They also need to configure the source database for replication (binary logging). Cloud SQL proxy is for connecting applications, not migration.

164
MCQmedium

A company wants to achieve 0 RPO for a Cloud SQL for MySQL instance. Which configuration should they use?

A.Enable cross-region replication to a replica in another region
B.Enable automatic backups with point-in-time recovery
C.Use a read replica in the same zone
D.Configure a Cloud SQL HA instance
AnswerD

HA instance uses synchronous replication within the same region, providing 0 RPO.

Why this answer

Option D is correct because Cloud SQL HA (high availability) instances use synchronous replication to a standby VM in a different zone within the same region, providing automatic failover with zero data loss (0 RPO). This configuration ensures that committed transactions are immediately replicated to the standby before acknowledging the commit, guaranteeing that no committed data is lost even if the primary zone fails.

Exam trap

Cisco often tests the distinction between synchronous and asynchronous replication, and the trap here is that candidates confuse cross-region replication or read replicas (both asynchronous) with the synchronous HA configuration, mistakenly believing they can achieve 0 RPO.

How to eliminate wrong answers

Option A is wrong because cross-region replication is asynchronous, meaning there is a replication lag that can result in data loss if the primary region fails before the replica catches up, thus it cannot guarantee 0 RPO. Option B is wrong because automatic backups with point-in-time recovery are taken at scheduled intervals (e.g., daily), so any data committed between the last backup and a failure is lost, making RPO non-zero. Option C is wrong because a read replica in the same zone is also asynchronous and does not provide automatic failover; it is designed for read scaling, not for high availability with zero data loss.

165
Multi-Selectmedium

You need to select a Google Cloud database for a global e-commerce platform that requires strong consistency for inventory updates, but can tolerate eventual consistency for product reviews. Which THREE services would you consider appropriate for the different parts of the platform?

Select 3 answers
A.Bigtable for real-time user behavior tracking
B.BigQuery for storing product reviews
C.Firestore for product reviews
D.Cloud SQL for inventory
E.Cloud Spanner for inventory data
AnswersA, C, E

Bigtable can handle high-throughput write/read for real-time tracking with eventual consistency.

Why this answer

Bigtable is correct for real-time user behavior tracking because it is a fully managed, scalable NoSQL database designed for high-throughput, low-latency workloads like time-series data, user analytics, and event logging. It supports strong consistency for single-row operations, which is sufficient for tracking individual user events in real time, and can handle millions of writes per second across a global footprint.

Exam trap

Cisco often tests the misconception that BigQuery can serve as an operational database for storing and querying product reviews in real time, when in fact it is a data warehouse for analytics and not designed for transactional or low-latency read/write operations.

166
MCQmedium

An e-commerce platform uses Cloud SQL for PostgreSQL. They need to reduce read load on the primary instance and provide low-latency reads for geographically distributed users. Which configuration should they implement?

A.Add read replicas in multiple regions
B.Use Cloud CDN to cache database responses
C.Enable cross-region replication using Cloud SQL's built-in failover replica
D.Migrate to Cloud Spanner
AnswerA

Read replicas in different regions can serve read traffic locally, reducing latency and load on the primary.

Why this answer

Cloud SQL read replicas are used to offload read traffic and provide low-latency reads from different regions. They are asynchronous replicas that can be promoted in case of failure.

167
MCQhard

You have a Cloud Bigtable instance with a single table that stores user events. You need to ensure that data older than 30 days is automatically deleted. What should you configure?

A.Set a garbage collection policy on the default column family to delete cells older than 30 days
B.Set a time-to-live (TTL) on the table
C.Use a cron job to manually delete rows with timestamps older than 30 days
D.Enable compaction and set a TTL on the table
AnswerA

Garbage collection policies on column families can delete based on age, e.g., max_age = 30 days.

Why this answer

Bigtable garbage collection policies operate on column families and can delete cells older than a specified time or keep a max number of versions.

168
Multi-Selectmedium

You are designing a Cloud Bigtable schema for a time-series application. To optimize performance and avoid hot spots, which THREE row key design practices should you follow? (Choose 3)

Select 3 answers
A.Place the highest cardinality field (e.g., device ID) first in the row key
B.Use a single table for all data
C.Use sequential integers as row keys
D.Reverse the timestamp so that recent data does not create hot spots
E.Salt the key with a random prefix to distribute writes
AnswersA, D, E

High cardinality field first distributes rows across tablets.

Why this answer

Reversing timestamps, salting keys, and promoting high-cardinality fields to the start of the row key are recommended to distribute writes evenly.

169
MCQeasy

You need a managed database service for a lift-and-shift migration of an on-premises SQL Server 2019 OLTP application with up to 64 TB of data. Which Google Cloud database should you choose?

A.Cloud Bigtable
B.AlloyDB
C.Cloud Spanner
D.Cloud SQL
AnswerD

Cloud SQL supports SQL Server 2019 and offers up to 64 TB storage.

Why this answer

Cloud SQL is the correct choice because it supports SQL Server 2019, provides managed database services with up to 64 TB of storage (via the Enterprise Plus tier with 64 TB SSD capacity), and is ideal for lift-and-shift migrations of OLTP workloads without requiring application changes. It offers high availability, automated backups, and compatibility with SQL Server features like T-SQL and linked servers, making it a direct replacement for on-premises SQL Server.

Exam trap

The trap here is that candidates often confuse Cloud Spanner's global scalability with a general-purpose relational database, but the question specifies a lift-and-shift migration of SQL Server 2019, which requires native SQL Server compatibility that only Cloud SQL provides among the options.

How to eliminate wrong answers

Option A is wrong because Cloud Bigtable is a NoSQL, wide-column database designed for large-scale analytical and operational workloads (e.g., time-series, IoT) with low-latency reads/writes, not for relational OLTP applications requiring SQL Server compatibility and ACID transactions. Option B is wrong because AlloyDB is a PostgreSQL-compatible database optimized for high-performance transactional and analytical workloads, but it does not support SQL Server T-SQL or the lift-and-shift of a SQL Server 2019 application without significant schema and query changes. Option C is wrong because Cloud Spanner is a globally distributed, horizontally scalable relational database with strong consistency, but it is not designed for lift-and-shift migrations of SQL Server workloads due to its proprietary SQL dialect, lack of SQL Server compatibility, and higher cost/complexity for a single-region OLTP application with up to 64 TB of data.

170
MCQhard

A Cloud Spanner database has a table Orders with a child table OrderItems. Queries often join Orders and OrderItems on OrderID. Which schema design optimizes performance for these joins?

A.Define a secondary index on OrderItems.OrderID
B.Use a global index on Orders.OrderID
C.Denormalize OrderItems data into the Orders table
D.Make OrderItems an interleaved table under Orders
AnswerD

Interleaving stores child rows with parent rows in the same split, minimizing join latency.

Why this answer

Interleaved tables store child rows with their parent row in the same split, colocating related data and reducing cross-node communication. This is the correct optimization for parent-child joins.

← PreviousPage 3 of 3 · 170 questions total

Ready to test yourself?

Try a timed practice session using only Pcd Design Scalable questions.

CCNA Pcd Design Scalable Questions — Page 3 of 3 | Courseiva