Apache Cassandra Developer Associate study materials
Apache Cassandra Developer Associate study resources

Apache Cassandra Developer Associate practice questions

One question at a time. Build your Apache Cassandra Developer Associate understanding.

First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1Cassandra Architecture and Data Distribution

In a Cassandra cluster, which component is responsible for mapping partition keys to token values and thereby determining data placement across nodes?

  1. The commit log
  2. The partitioner Correct answer.
  3. The compaction strategy
  4. The snitch

Explanation

The partitioner hashes a partition key into a token, and that token determines which node owns the data on the ring. The snitch only informs the coordinator about network topology and proximity, not token assignment.

Question 2Cassandra Architecture and Data Distribution

A table is created with a replication factor of 3 in a single datacenter. How many replica copies of each partition are stored in that datacenter?

  1. Six
  2. Two
  3. One
  4. Three Correct answer.

Explanation

Replication factor specifies the number of replicas kept per datacenter. With RF=3 in one datacenter, three nodes hold a copy of each partition.

Question 3Cassandra Architecture and Data Distribution

Which statement correctly describes how Cassandra arranges nodes on the ring when using the Murmur3Partitioner?

  1. Every node owns the full token range and stores all partitions.
  2. Nodes are ordered alphabetically by hostname around the ring.
  3. Each node owns a contiguous range of tokens, and ranges wrap around the ring. Correct answer.
  4. Tokens are assigned only to seed nodes, which forward all writes.

Explanation

With Murmur3Partitioner, each node is assigned one or more tokens, and ownership is defined by the token ranges between adjacent tokens, wrapping at the ring boundary. Hostname order is irrelevant to data placement.

Question 4Cassandra Architecture and Data Distribution

What is the primary purpose of the gossip protocol in a Cassandra cluster?

  1. To propagate cluster membership and node state information between nodes Correct answer.
  2. To coordinate the two-phase commit of lightweight transactions
  3. To compress data before it is written to disk
  4. To stream SSTables during bootstrap and repair

Explanation

Gossip is a peer-to-peer protocol that disseminates node liveness, schema versions, and endpoint state so every node maintains an eventually consistent view of the cluster. It does not move bulk data or coordinate Paxos rounds.

Question 5Cassandra Architecture and Data Distribution

Which file is written first when a mutation arrives at a replica, providing durability before the data is flushed from memory?

  1. The secondary index
  2. The commit log Correct answer.
  3. The SSTable
  4. The hints file

Explanation

Mutations are appended to the commit log for durability and simultaneously written to the in-memory memtable. Memtables are later flushed to immutable SSTables on disk.

Question 6Cassandra Architecture and Data Distribution

Which snitch should be configured when nodes run in a single datacenter and the operator wants Cassandra to infer rack proximity from network topology without manual property files?

  1. GossipingPropertyFileSnitch Correct answer.
  2. SimpleSnitch
  3. Ec2Snitch
  4. DynamicSnitch alone

Explanation

GossipingPropertyFileSnitch reads datacenter and rack from cassandra-rackdc.properties and gossips that information to peers, which suits multi-rack single-datacenter deployments. SimpleSnitch treats the topology as one datacenter and one rack.

Question 7Cassandra Architecture and Data Distribution

What does a consistency level of QUORUM require for a read in a keyspace with replication factor 3?

  1. A response from the single closest replica
  2. Responses from all three replicas
  3. Responses from at least two replicas Correct answer.
  4. Responses from a majority of all nodes in the cluster

Explanation

QUORUM means a majority of the replicas for the queried partition must respond. With RF=3, that majority is two replicas.

Question 8Cassandra Architecture and Data Distribution

Which component on a node stores recently written data in memory before it is flushed to disk as SSTables?

  1. The commit log
  2. The memtable Correct answer.
  3. The bloom filter
  4. The partition index

Explanation

The memtable is the in-memory structure that buffers mutations; once it exceeds its threshold it is flushed to an SSTable. The commit log provides durability for the same writes but is not the in-memory table itself.

Question 9Cassandra Architecture and Data Distribution

A cluster uses NetworkTopologyStrategy with replication_factor 3 in datacenter dc1 and 2 in datacenter dc2. Which statement describes where replicas are placed?

  1. All five replicas are placed in dc1 and none in dc2.
  2. Two replicas are placed in dc1 and three in dc2.
  3. Five replicas are placed in whichever datacenter holds the coordinator.
  4. Three replicas are placed in dc1 and two in dc2, spread across racks where possible. Correct answer.

Explanation

NetworkTopologyStrategy takes an explicit replication factor per datacenter, so dc1 receives three replicas and dc2 receives two. It also attempts to distribute replicas across distinct racks within each datacenter.

Question 10Cassandra Architecture and Data Distribution

A read is issued at consistency level QUORUM and the coordinator receives a newer value from one replica and an older value from another. What does Cassandra do?

  1. It returns the value with the highest timestamp after comparing timestamps. Correct answer.
  2. It returns the value stored on the node with the lowest token.
  3. It returns the first response received and discards the rest.
  4. It aborts the read and raises a ReadTimeoutException.

Explanation

Cassandra resolves conflicts by last-write-wins using the cell timestamp; the coordinator compares timestamps across replicas that respond and returns the newest value. It also triggers read repair on the stale replica.

Question 11Cassandra Architecture and Data Distribution

Which condition must hold for a write at consistency level QUORUM and a read at consistency level QUORUM to guarantee strong consistency in a single datacenter?

  1. Replication factor must be 1.
  2. The read must use consistency level ONE.
  3. The write quorum and read quorum together must exceed the replication factor. Correct answer.
  4. All replicas must reside on the same rack.

Explanation

Strong consistency requires that the write set and read set overlap, which holds when W + R > RF. With RF=3, QUORUM writes and QUORUM reads satisfy 2 + 2 > 3.

Question 12Cassandra Architecture and Data Distribution

What is the role of a seed node in a Cassandra cluster?

  1. It permanently owns the token range for the zero token.
  2. It performs all compactions for the cluster.
  3. It stores all schema definitions and is the only node allowed to accept DDL.
  4. It serves as a contact point that new nodes use to discover the cluster topology. Correct answer.

Explanation

Seeds are listed in cassandra.yaml and act as gossip contact points so joining nodes can learn about the rest of the cluster. They are not special for data ownership, schema authority, or compaction.

Question 13Cassandra Architecture and Data Distribution

A node is added to a cluster using nodetool bootstrap and begins streaming data. Which mechanism ensures other nodes know the new node has joined and owns new ranges?

  1. The partitioner rewrites all existing SSTables to include the new node.
  2. The snitch sends a repair request to every rack.
  3. Gossip and the endpoint state propagate the new node's tokens and status. Correct answer.
  4. The new node broadcasts a commit log entry to all peers.

Explanation

When a node joins, it announces its tokens and status through gossip, and other nodes update their view of the ring. Streaming transfers the ranges the new node now owns.

Question 14Cassandra Architecture and Data Distribution

Which statement best describes how hinted handoff behaves when a replica is temporarily down during a write?

  1. The coordinator stores a hint and delivers it to the replica when it returns within the hint window. Correct answer.
  2. The coordinator immediately streams the full SSTable to the replica.
  3. The write is redirected to a node in another datacenter permanently.
  4. The write is rejected with an UnavailableException in all cases.

Explanation

If a replica does not acknowledge a write, the coordinator can save a hint locally and replay it once the replica is reachable again, provided the hint has not expired. This keeps writes available without immediate repair.

Question 15Cassandra Architecture and Data Distribution

What does anti-entropy repair using nodetool repair primarily accomplish?

  1. It rebalances token ownership across the ring.
  2. It compares data across replicas using Merkle trees and reconciles differences. Correct answer.
  3. It compacts SSTables to reduce disk usage.
  4. It flushes memtables to disk before a restart.

Explanation

Repair builds Merkle trees of the data each replica holds for a range, compares them, and streams the differences so replicas converge. It addresses divergence caused by failures and missed hints.

Question 16Cassandra Architecture and Data Distribution

Which consistency level guarantees that a write is persisted to the commit log and memtable on all replicas in all datacenters before acknowledging?

  1. ALL Correct answer.
  2. TWO
  3. LOCAL_QUORUM
  4. EACH_QUORUM

Explanation

ALL requires acknowledgment from every replica for the partition across all datacenters. EACH_QUORUM only requires a quorum in each datacenter, not every replica.

Question 17Cassandra Architecture and Data Distribution

A table uses SizeTieredCompactionStrategy and a node accumulates many similarly sized SSTables. What is the expected behavior when the compaction threshold is met?

  1. All SSTables are rewritten into a single file on every flush.
  2. The largest SSTable is deleted to free space.
  3. Similar-sized SSTables are merged into a larger SSTable. Correct answer.
  4. SSTables are streamed to another node for compaction.

Explanation

SizeTieredCompactionStrategy groups SSTables of comparable size and merges them into a larger SSTable once enough candidates exist. This reduces the number of files and eliminates obsolete versions.

Question 18Cassandra Architecture and Data Distribution

Which structure inside an SSTable allows a read to avoid scanning a file that definitely does not contain the requested partition key?

  1. The bloom filter Correct answer.
  2. The commit log segment
  3. The gossip digest
  4. The hinted handoff log

Explanation

Each SSTable carries a bloom filter that can conclusively rule out the presence of a key, so reads skip files that cannot contain it. This reduces disk I/O during reads.

Question 19Cassandra Architecture and Data Distribution

In a multi-datacenter deployment, what is the effect of using LOCAL_QUORUM for reads and writes compared with QUORUM?

  1. LOCAL_QUORUM ignores replication factor entirely.
  2. LOCAL_QUORUM requires every replica in the local datacenter to respond.
  3. LOCAL_QUORUM waits for a quorum of replicas in the coordinator's datacenter only. Correct answer.
  4. LOCAL_QUORUM waits for a quorum of replicas across all datacenters.

Explanation

LOCAL_QUORUM satisfies the consistency requirement using replicas in the coordinator's own datacenter, avoiding cross-datacenter latency. The global QUORUM level counts replicas across all datacenters.

Question 20Cassandra Architecture and Data Distribution

A coordinator receives a read request and the first replica responds with the data while a second replica is slow. At consistency level ONE, what happens?

  1. The coordinator waits for all replicas before returning data.
  2. The coordinator returns an error because not all replicas responded.
  3. The coordinator can return the first replica's response immediately and may perform read repair in the background. Correct answer.
  4. The coordinator cancels the request and retries on another node.

Explanation

At consistency level ONE, only one replica response is required, so the coordinator can satisfy the read as soon as a replica answers. It may still send digest requests to other replicas and repair stale data asynchronously.

Question 21Cassandra Architecture and Data Distribution

Which statement about the role of the coordinator node is correct?

  1. The coordinator is always the node that owns the partition being queried.
  2. The coordinator must be a seed node.
  3. The coordinator stores a permanent copy of every partition it coordinates.
  4. The coordinator is the node that receives the client request and routes it to the responsible replicas. Correct answer.

Explanation

Any node can act as coordinator for a client request; it determines the replicas that own the partition and forwards the operation. It does not need to own the data or be a seed.

Question 22Cassandra Architecture and Data Distribution

A cluster uses vnodes with num_tokens set to 16 per node. Which benefit does this configuration provide compared with a single token per node?

  1. It guarantees that each node owns exactly one contiguous range.
  2. It removes the need for a partitioner.
  3. It distributes each node's ownership across many smaller ranges, improving balance and repair parallelism. Correct answer.
  4. It eliminates the need for replication.

Explanation

Virtual nodes give each node many small token ranges, which improves data distribution and lets streaming and repair proceed in parallel across ranges. A single token per node produces one large contiguous range and can be unbalanced.

Question 23Cassandra Architecture and Data Distribution

During a nodetool repair with the default incremental settings in a cluster that has experienced no failures, what is the primary reason the repair still performs work?

  1. It must recreate secondary indexes on every replica.
  2. It must re-gossip schema versions to all nodes.
  3. It must rewrite every SSTable to change the token assignment.
  4. It validates Merkle trees and reconciles any divergence, including data written with different timestamps or missed hints. Correct answer.

Explanation

Repair compares Merkle trees across replicas and streams differences, which also covers divergence from expired hints, dropped mutations, or concurrent writes. Even without a known failure, divergence can exist and must be reconciled.

Question 24Cassandra Architecture and Data Distribution

A keyspace uses NetworkTopologyStrategy with RF=3 in a datacenter that has three racks, each containing one node. A write at LOCAL_QUORUM succeeds. If one entire rack becomes unavailable, what is the consequence for reads at LOCAL_QUORUM?

  1. Reads at LOCAL_QUORUM can still succeed because two replicas remain available. Correct answer.
  2. Reads at LOCAL_QUORUM must fail because one replica is missing.
  3. Reads at LOCAL_QUORUM are routed to another datacenter automatically.
  4. Reads at LOCAL_QUORUM succeed only if consistency level ALL is used.

Explanation

With RF=3 spread across three racks, losing one rack leaves two replicas, which satisfies a local quorum of two. LOCAL_QUORUM does not require every replica, so reads continue to succeed.

Question 25Cassandra Architecture and Data Distribution

Which scenario describes a read that is guaranteed to observe the most recent acknowledged write in a single datacenter with RF=3, assuming no failures and no clock skew?

  1. A write at QUORUM followed by a read at QUORUM Correct answer.
  2. A write at ONE followed by a read at ONE
  3. A write at ONE followed by a read at QUORUM
  4. A write at ANY followed by a read at ALL

Explanation

Strong read-after-write consistency requires the write quorum and read quorum to overlap. With RF=3, QUORUM writes and QUORUM reads both touch two replicas, and any two such sets intersect, so the read sees the latest write.

Question 26Cassandra Architecture and Data Distribution

Which data structure does a Cassandra node use to map each token range to the replica nodes responsible for it?

  1. The commit log segment directory
  2. The bloom filter of the active memtable
  3. The partition index stored in each SSTable
  4. The token ring metadata held by the gossip state Correct answer.

Explanation

Cassandra maintains a token ring in which every node owns one or more token ranges, and the mapping of tokens to endpoints is propagated through gossip. Each coordinator consults this ring metadata to decide which replicas should receive a request for a given partition key. SSTable indexes and bloom filters are per-file read structures and do not describe ownership.

Question 27Cassandra Architecture and Data Distribution

A table is created with PRIMARY KEY ((region), user_id) and no clustering columns. How are the rows for a single region distributed across the cluster?

  1. Rows are assigned to replicas by the token computed from the full partition key value (region). Correct answer.
  2. Rows are round-robin distributed across all nodes regardless of key values.
  3. Rows are distributed by the token of user_id alone, ignoring region.
  4. All rows of a region are stored together on the node owning the region token.

Explanation

The first component of the primary key is the partition key, and here that is the region column alone, wrapped in parentheses. Cassandra hashes that partition key value to a token, and every row sharing the same region lands in the same partition on the same replica set. The user_id column is not part of the partition key, so it cannot influence placement.

Question 28Cassandra Architecture and Data Distribution

An operator sets num_tokens to 256 on a new node while existing nodes were built with num_tokens 8 and no allocation algorithm. What is the most accurate description of the resulting ring?

  1. Cassandra rejects the join because all nodes must share the same num_tokens value.
  2. The new node owns many small ranges whose total share is uneven relative to the older nodes. Correct answer.
  3. The new node owns 256 evenly sized ranges, giving it a fair share of the data.
  4. The new node automatically rebalances the older nodes to 256 tokens each during bootstrap.

Explanation

With random token selection, each of the 256 tokens is an independent random point, so the sum of the new node's ranges approximates its fair share but with more variance than a properly allocated ring, and it is not equal to the older nodes' ownership. Cassandra does not require uniform num_tokens across nodes, and it does not rewrite other nodes' tokens during bootstrap. The practical guidance is to use the same num_tokens and allocation algorithm on every node.

Question 29Cassandra Architecture and Data Distribution

What does the partitioner determine in a Cassandra cluster?

  1. How the token is computed from a partition key, and therefore which node owns the data Correct answer.
  2. How often the commit log is flushed to disk
  3. How many replicas each keyspace must maintain per datacenter
  4. How long tombstones are retained before compaction removes them

Explanation

The partitioner is the function that hashes a partition key into a token on the ring, so it directly governs data placement and the order of data on disk. Replication counts come from the keyspace strategy, while flush timing and tombstone retention are controlled by other settings such as compaction and gc_grace_seconds.

Question 30Cassandra Architecture and Data Distribution

A three-node single-datacenter cluster uses SimpleStrategy with replication factor 2. Node A owns the token for key K and Node B is its next replica. Node B fails permanently. Which statement describes read availability for K before repair runs?

  1. Reads for K fail until B is replaced, because a replica is missing.
  2. Reads for K are served by the coordinator recomputing a new token to exclude B.
  3. Reads for K succeed from A at consistency ONE, and B's missed writes are replayed from hints when it returns. Correct answer.
  4. Reads for K succeed only at consistency ALL, because B cannot respond.

Explanation

With RF 2, A alone can satisfy a read at consistency ONE, so availability is preserved while B is down. Writes that A acknowledged while B was unavailable are stored as hints and replayed when B returns, and anti-entropy repair reconciles any divergence. The token ring is not recomputed merely because a replica is offline.

Question 31Data Modeling and Schema Design

In Cassandra, which element of a table definition determines the on-disk order of rows within a partition?

  1. The static columns
  2. The partition key columns
  3. The secondary indexes
  4. The clustering columns Correct answer.

Explanation

Clustering columns define the sort order of rows inside a partition and are stored contiguously on disk in that order, which is why range scans over them are efficient. Partition key columns determine which node stores the row, not the ordering within the partition.

Question 32Data Modeling and Schema Design

A table is declared as PRIMARY KEY ((user_id, bucket), event_time). What does this definition produce?

  1. A partition key of user_id, with bucket and event_time as clustering columns
  2. A partition key of user_id and a static clustering column named bucket
  3. A composite partition key of user_id and bucket, clustered by event_time Correct answer.
  4. Three separate partitions, one per key column

Explanation

The extra parentheses around user_id and bucket mark them together as the composite partition key, while event_time outside that group is the clustering column. Composite partition keys spread data across more tokens to avoid hot partitions.

Question 33Data Modeling and Schema Design

Which statement about the role of a partition key in Cassandra is accurate?

  1. It is hashed to a token that determines the replicas responsible for the row Correct answer.
  2. It must be unique across the entire cluster for every row
  3. It can be updated in place with a normal UPDATE statement
  4. It is used to sort rows within a partition in ascending order

Explanation

Cassandra applies a partitioner hash to the partition key to produce a token, and the token's position on the ring selects the replicas. The same partition key value always maps to the same token, which is why it cannot be changed in place.

Question 34Data Modeling and Schema Design

A team models sensor readings with PRIMARY KEY ((sensor_id, day), reading_time). What is the main design benefit of adding day to the partition key?

  1. It bounds partition size so a single sensor's history does not grow without limit Correct answer.
  2. It enables lightweight transactions on the table
  3. It guarantees strong consistency for reads of the partition
  4. It removes the need for a clustering column

Explanation

Bucketing by day splits an ever-growing time series into many bounded partitions, which keeps partition size and read cost predictable. Partition size is a practical limit in Cassandra, so time-bucketing is a standard mitigation.

Question 35Data Modeling and Schema Design

Which schema change lets a query filter efficiently on a non-key column such as status without allowing filtering?

  1. Create a separate query table keyed by status and the relevant time column Correct answer.
  2. Increase the replication factor of the keyspace
  3. Declare status as a static column
  4. Add status as an additional clustering column before the timestamp

Explanation

Cassandra favors query-driven modeling: instead of indexing ad hoc, you create a dedicated table whose partition and clustering keys match the access pattern. This keeps reads single-partition and avoids ALLOW FILTERING scans.

Question 36Data Modeling and Schema Design

What happens when you insert two rows with identical partition key and identical clustering column values into the same table?

  1. The second write becomes an upsert that overwrites the non-key columns Correct answer.
  2. The second write is rejected with an error
  3. Both rows are stored and returned as duplicates
  4. The rows are merged only after compaction runs

Explanation

The full primary key uniquely identifies a row, so a write with the same key is an upsert: it replaces the values of the non-key columns (subject to timestamp resolution). There is no duplicate-row concept in a Cassandra table.

Question 37Data Modeling and Schema Design

A developer wants a column that stores one value shared by every row in a partition, such as a user's display name alongside many activity rows. Which feature fits?

  1. A frozen collection
  2. A counter column
  3. A static column Correct answer.
  4. A clustering column

Explanation

Static columns store a single value per partition rather than per row, so they are ideal for denormalized attributes shared by all rows in that partition. They must be declared with the STATIC keyword and cannot be part of the primary key.

Question 38Data Modeling and Schema Design

Which collection type in Cassandra preserves insertion order while allowing duplicate elements?

  1. set
  2. tuple
  3. list Correct answer.
  4. map

Explanation

A list keeps elements in insertion order and permits duplicates. A set is unordered and de-duplicated, a map is keyed, and a tuple is a fixed-length ordered group of typed fields.

Question 39Data Modeling and Schema Design

Why might a developer mark a collection column as frozen?

  1. To permit the collection to hold values of different types
  2. To allow individual elements to be updated with a partial write
  3. To compress the collection on disk automatically
  4. To make the collection immutable so it can be used as part of a primary key Correct answer.

Explanation

A frozen collection is serialized as a single immutable value, which allows it to appear in a primary key and be used in comparisons. The trade-off is that updating means rewriting the whole collection.

Question 40Data Modeling and Schema Design

What is the recommended approach for storing large binary objects such as images in Cassandra?

  1. Store the full blob in a single row column without size limits
  2. Store the blob in a chunked table and keep a reference in the main table Correct answer.
  3. Store the blob in a clustering column
  4. Store the blob in a static column so it is written once

Explanation

Very large blobs create oversized partitions and stress the heap and network, so the common pattern is to chunk the data across rows and store a pointer. Cassandra documentation advises keeping individual values modest in size.

Question 41Data Modeling and Schema Design

A table uses PRIMARY KEY (id) with a single partition key and no clustering columns. Which query is valid without ALLOW FILTERING?

  1. SELECT * FROM t ORDER BY other
  2. SELECT * FROM t WHERE id > 5
  3. SELECT * FROM t WHERE id = 5 AND other = 'x'
  4. SELECT * FROM t WHERE id = 5 Correct answer.

Explanation

With only a partition key, the only efficient access is an equality lookup on that key. Range predicates on a partition key, predicates on non-key columns, and ordering by a non-clustering column all require a scan.

Question 42Data Modeling and Schema Design

For a table with PRIMARY KEY (a, b, c), which WHERE clause is allowed without ALLOW FILTERING?

  1. WHERE a = 1 AND c = 3
  2. WHERE b = 1
  3. WHERE a = 1 AND b = 2 Correct answer.
  4. WHERE c = 3

Explanation

Clustering columns must be restricted in their declared order starting from the first, so restricting a and b together is valid. Skipping b to restrict c, or restricting b or c without a, requires filtering.

Question 43Data Modeling and Schema Design

In a table with PRIMARY KEY (a, b, c), what is the effect of declaring c with CLUSTERING ORDER BY (c DESC)?

  1. Rows within each partition are stored and returned with descending c values Correct answer.
  2. The partition key tokens are distributed in descending order across the ring
  3. The entire table is returned in descending order across all partitions
  4. The value of c is negated before being stored

Explanation

CLUSTERING ORDER BY controls the on-disk sort order of rows inside each partition, which is useful for time-series reads that want newest first. It does not affect token distribution or global ordering across partitions.

Question 44Data Modeling and Schema Design

Which situation most strongly indicates that a table's partition is too large?

  1. The cluster has many nodes and a high replication factor
  2. The table has more clustering columns than partition key columns
  3. The table uses a composite partition key with two columns
  4. Reads for a single partition time out or show high latency and wide row counts Correct answer.

Explanation

Oversized partitions concentrate data on few nodes and force large reads and compactions, which shows up as latency, timeouts, and very wide rows. Bucketing the partition key is the usual remedy.

Question 45Data Modeling and Schema Design

What is the primary purpose of a secondary index (2i) in Cassandra?

  1. To replace the partition key for token routing
  2. To allow lookups on a low-cardinality non-key column without a separate table Correct answer.
  3. To enforce uniqueness on a column
  4. To provide full-text search with relevance ranking

Explanation

Secondary indexes let you query a non-key column, but they work best on low-cardinality columns and can fan out to many nodes. They do not enforce uniqueness and are not a search engine.

Question 46Data Modeling and Schema Design

A team needs to look up users by email, which is highly unique. Which design is generally preferred over a secondary index on email?

  1. A clustering column on the existing users table
  2. A static column holding the email
  3. A counter column for each email
  4. A separate table partitioned by email as the primary key Correct answer.

Explanation

High-cardinality lookups are better served by a dedicated table whose partition key is the lookup column, giving a single-partition read. Secondary indexes on high-cardinality columns can scan many nodes and perform poorly.

Question 47Data Modeling and Schema Design

What does the ALLOW FILTERING clause do when added to a SELECT statement?

  1. It relaxes the consistency level for the read
  2. It creates an index automatically to serve the predicate
  3. It permits the query to scan and filter rows server-side, potentially with high latency Correct answer.
  4. It caches the result set for later queries

Explanation

ALLOW FILTERING tells Cassandra to accept a query it cannot serve from the primary key alone, which may require scanning many partitions. It is a performance escape hatch, not an optimization.

Question 48Data Modeling and Schema Design

Which data type is appropriate for storing a monotonically increasing time value that will be used as a clustering column for time-series data?

  1. uuid
  2. boolean
  3. counter
  4. timestamp Correct answer.

Explanation

The timestamp type stores a date and time with millisecond precision and sorts naturally, making it well suited to time-series clustering. UUIDs are unique identifiers, booleans are two-valued, and counters cannot be primary key columns.

Question 49Data Modeling and Schema Design

Which type should be chosen for a column that stores a unique identifier generated by the client without coordination?

  1. uuid Correct answer.
  2. decimal
  3. blob
  4. int

Explanation

The uuid type stores a 128-bit identifier that clients can generate independently while remaining effectively unique. Integers can collide without coordination, decimals are for exact numeric values, and blobs store raw bytes.

Question 50Data Modeling and Schema Design

What is the main consequence of using a very high-cardinality partition key such as a random UUID for every row?

  1. The cluster cannot store more than one row per partition
  2. Data is spread evenly but range queries across related rows become many separate partition reads Correct answer.
  3. Data is concentrated on a few nodes, creating hot spots
  4. Secondary indexes become mandatory for all queries

Explanation

A random high-cardinality key distributes load well but scatters logically related rows across the ring, so fetching a group requires multiple partition reads. Modeling must balance even distribution against the need to read related rows together.