Confluent's CCDAK and CCAAK both ask whether you can use Kafka safely and predictably from development and operations angles. This article distills the recurring exam-style decision points across the core domains, anchored in past patterns and the stable behaviors documented in the official spec.
The sample questions are practice-flavored sketches, but each one comes with settings and trade-offs that translate to real work — try reproducing them on your own cluster as you read.
Kafka message delivery falls into three patterns: at-least-once, exactly-once, and at-most-once. On the producer side, the outcome depends on the combination of acks, retries, enable.idempotence, and max.in.flight.requests.per.connection. On the consumer side, the offset-commit timing matters, along with transactions and the read isolation level.
Exactly-Once Semantics (EOS) is reachable when you treat Kafka's read-process-write loop as a single atomic unit with an idempotent producer, transactions, and read_committed reads. Extending exactly-once to external systems is only possible when those systems also support transactional coordination.
| Semantics | Loss possible? | Duplicates possible? | Typical settings / conditions |
|---|---|---|---|
| At-most-once | Yes | No | Commit before send or do not retry; retries=0 is typical |
| At-least-once | No (in principle) | Yes | retries>0, acks=all, commit after processing |
| Exactly-once | No (within the design envelope) | No (within the design envelope) | enable.idempotence=true, transactional.id, acks=all, read_committed |
Producer → broker → consumer flow under EOS
Example producer configuration (EOS)
bootstrap.servers=broker:9092
aacks=all
enable.idempotence=true
retries=2147483647
max.in.flight.requests.per.connection=5
transactional.id=orders-txn-01
Ordering is guaranteed per partition. If you need to preserve order for a particular key, you must set the key. Without a key, current clients default to the sticky partitioner, which batches into the same partition for short windows and boosts throughput, but it cannot guarantee strict ordering.
To avoid hot partitions: keep key cardinality high, plan partition count against consumer parallelism, and reach for a custom partitioner when needed. You can grow partition count in a backward-compatible way, but shrinking it is hard — keep that asymmetry in mind.
Java producer key-specification example
producer.send(new ProducerRecord<>("orders", customerId, payload));
// customerIdで順序保証(同一キーは同一パーティション)
Time-based retention is controlled by retention.ms and size by retention.bytes. Data becomes eligible for removal only after it crosses a segment boundary (segment.ms / segment.bytes). When cleanup.policy=delete, old segments are removed once they hit the time or size cap.
With cleanup.policy=compact, the latest record per key is retained and earlier ones become compaction candidates. Deletes are expressed as a tombstone for the key and physically removed after delete.retention.ms. Compaction is eventually consistent, not immediate.
Representative per-topic retention and compaction settings
kafka-topics.sh --bootstrap-server broker:9092 \
--alter --topic users \
--config cleanup.policy=compact,delete \
--config retention.ms=604800000 \
--config segment.ms=3600000
Replication factor (e.g., 3) and ISR (In-Sync Replicas) form the bedrock of availability. acks=all returns success only after every ISR replica has caught up. min.insync.replicas sets the minimum ISR count required for writes; pairing it with acks=all raises durability during failures.
Leader election normally picks from the ISR. Setting unclean.leader.election.enable=false forbids elections from out-of-sync followers and prevents data loss, although downtime may extend. Rack awareness uses broker placement data to spread replicas across different racks.
Key points for the server configuration
min.insync.replicas=2
unclean.leader.election.enable=false
# ラックアウェアネス
broker.rack=az1
Schema Registry manages Avro/Protobuf/JSON Schema and codifies compatibility modes (BACKWARD, FORWARD, FULL, and others). BACKWARD compatibility is the usual choice for adding events. Removing fields or adding required ones breaks backward compatibility, and exams often surface these as 'inappropriate' changes.
The Confluent wire format embeds a schema ID after a leading magic byte (0). Clients use the ID for deserialization, and compatibility checks are applied at registration time.
Compatibility mode configuration example
curl -s -X PUT -H "Content-Type: application/json" \
--data '{"compatibility":"BACKWARD"}' \
http://schema-registry:8081/config/subjects/orders-value
Encryption uses TLS, and you can choose authentication from SASL/PLAIN, SASL/SCRAM, OAuthBearer, mTLS, and so on. ACLs are granted as resource (Topic, Group, Cluster, etc.) × operation (Read, Write, Create, Describe, etc.). In operations, manage ACL principals and patterns (literal/prefix) explicitly.
Monitoring consumer lag, setting quotas, performing phased rolling upgrades, and leveraging cooperative rebalancing are the keys to stable operations. The cooperative-sticky rebalance minimizes pauses during rebalances.
ACL grant example (Write for producer, Read for consumer)
kafka-acls.sh --bootstrap-server broker:9092 \
--add --allow-principal User:alice \
--operation Write --topic payments
kafka-acls.sh --bootstrap-server broker:9092 \
--add --allow-principal User:bob \
--operation Read --topic payments --group payments-cg
CCDAK / CCAAK
問題 1
A topic has replication factor 3 and min.insync.replicas=2, and the producer sends with acks=all. A single broker failure drops the ISR from 2 to 1. Which behavior is most expected?
正解: B
acks=all waits for the entire ISR to catch up, and min.insync.replicas=2 demands at least two replicas to write simultaneously. Once the ISR drops to 1, the condition cannot be met, so produce calls keep failing with NotEnoughReplicas. This is the correct, durability-first behavior.
Can exactly-once be guaranteed all the way to an external database?
Inside Kafka's read-process-write loop, exactly-once is achievable via transactions. Extending it to an external database requires that the database support the same transactional boundary or a two-phase commit. Typical JDBC sinks struggle to stretch true exactly-once outward, so you usually pursue effectively-once semantics through idempotent keys and upsert patterns.
Without a key, is partition selection always round-robin?
Current Kafka clients default to the sticky partitioner for better batching, so messages are concentrated on a single partition for short bursts. If you need strict ordering, set a key explicitly.
How is a "delete" expressed under log compaction?
You produce a null value (a tombstone) for the target key. After the configured retention window, compaction physically removes the older entries for that key along with the tombstone.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Kafka Topics & Partitions: Distribution Fundamentals (2026)
How Kafka topics and partitions enable scale — ordering guar...
CCDAK Exam Guide: Confluent Certified Developer (2026)
Complete prep for the CCDAK exam — Producer/Consumer API, St...
CCAAK Exam Guide: Confluent Certified Administrator (2026)
Pass the CCAAK exam — cluster management, partitions, securi...
Kafka Replicas & ISR: Fault Tolerance Explained (2026)
Replica placement, in-sync replicas (ISR), leader election. ...
Kafka Offsets: Commit Modes & Consumer Position (2026)
Offset semantics — auto vs. manual commit, __consumer_offset...