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

Apache Cassandra Developer Associate: Client Drivers and Application Development

Apache Cassandra Developer Associate · Work through your exam, one topic at a time.

All guide sections

Client Drivers and Application Development

This domain tests application integration: building a cluster/session, preparing statements, choosing consistency, handling retries and timeouts, paging, and applying backpressure. The exam expects you to know driver behavior rather than only CQL syntax.

Session lifecycle and routing

Create one long-lived cluster/session per application and reuse it; sessions are thread-safe and pool connections. Contact points are seeds for discovery, not a complete node list. A token-aware load-balancing policy routes requests to a replica when possible, reducing hops. Use prepared statements for repeated queries so the driver caches metadata and sends only bound values; avoid string-concatenated CQL.

Consistency, retries, idempotence

Set consistency per statement or session. LOCAL_QUORUM is common for multi-DC applications. Retries are safe only when the operation is idempotent; an INSERT of the same primary key and values usually is, but a counter increment or an append to a list is not. Read timeouts, write timeouts, unavailable exceptions, and overloaded exceptions have different causes. A retry policy should not hammer a struggling cluster; use exponential backoff and bounded attempts, and let the driver's speculative execution be used only for idempotent, latency-sensitive reads.

Worked example

A service writes user events. It prepares INSERT INTO events (user_id, event_time, kind) VALUES (?, ?, ?), binds values, and sets LOCAL_QUORUM. The statement is idempotent because the primary key is fixed and the values are fixed. If a write timeout occurs, retrying the same bound statement is safe. If the table used a counter for event_count, the same retry could double-count, so the application must use a unique event ID or avoid blind retries.

Paging and backpressure

The driver fetches pages; do not load an unbounded result set into memory. Iterate pages asynchronously or set fetch size. Limit concurrency with a semaphore or the driver's in-flight request limits. Monitor pool queues and request latency rather than only error counts.

Traps

Do not create a session per request. Do not retry non-idempotent statements. Do not assume contact points must include every node. Do not use ALLOW FILTERING to compensate for a missing partition key. Do not ignore token-aware routing when latency matters.