커밋 로그: Kafka의 데이터 저장 방식
Kafka가 메시지를 추가 전용 커밋 로그로 저장하는 방식과 오프셋 및 보존 정책의 작동 방식을 배우고, 이 설계가 Kafka를 빠르고 내구성 있게 만드는 이유를 이해하세요.
커밋 로그: Kafka의 데이터 저장 방식은(는) CoddyKit의 무료 Apache Kafka & Stream Processing Fundamentals 강의입니다. 이것은 4개 중 4번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Apache Kafka & Stream Processing Fundamentals 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Apache Kafka & Stream Processing Fundamentals 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
Kafka Is a Log
At its core Kafka is a distributed, append-only commit log. Producers append to the end and data is never modified in place — that's the secret to its speed and durability.
Append-Only Writes
Every record is written sequentially to the end of a partition's log. Sequential disk writes are far faster than random ones, sustaining high throughput on cheap disks.
The Offset
Each record gets a monotonically increasing offset — its position in the partition. Offsets are unique within a partition and never reused.
Partition 0: [off 0][off 1][off 2][off 3] -> next write off 4Reads Don't Delete
Unlike a queue, consuming a record does not delete it. Many consumers read the same log independently, each tracking its own offset.
Log Segments
A partition log is split into segment files on disk. Only the active segment is written to; older segments are immutable and can be deleted or compacted.
00000000000000000000.log
00000000000000010000.logRetention by Time
Kafka keeps data for a configurable period regardless of whether it's consumed. The default retention is 7 days.
retention.ms=604800000Retention by Size
You can also cap a partition by size. Whichever limit hits first — time or bytes — triggers deletion of the oldest segments.
retention.bytes=1073741824Log Compaction
Instead of deleting by age, compaction keeps only the latest record per key — perfect for changelog topics where you just want each key's current value.
cleanup.policy=compactZero-Copy Reads
Kafka serves reads straight from the OS page cache to the network using zero-copy, skipping extra memory copies. Another big reason consumption is so fast.
Durability via Flush and Replicas
Records are durable because they're written to disk and replicated to other brokers. Even if the OS cache is lost, replicas preserve the data.
Putting It Together
The commit log explains Kafka's character: sequential writes for speed, offsets for replayable reads, retention and compaction for storage, replication for durability.
Quick Check
Test your understanding of the commit log.
Recap
You learned Kafka's storage: an append-only commit log with stable offsets, reads that don't delete, retention plus compaction, and replication for durability.
자주 묻는 질문
“커밋 로그: Kafka의 데이터 저장 방식” 강의는 무료인가요?
네 — “커밋 로그: Kafka의 데이터 저장 방식” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Apache Kafka & Stream Processing Fundamentals 강의 전체를 잠금 해제할 수 있습니다. Apache Kafka & Stream Processing Fundamentals 강의에는 총 4개의 강의가 포함되어 있습니다.
“커밋 로그: Kafka의 데이터 저장 방식”에서 뭘 배우나요?
Kafka가 메시지를 추가 전용 커밋 로그로 저장하는 방식과 오프셋 및 보존 정책의 작동 방식을 배우고, 이 설계가 Kafka를 빠르고 내구성 있게 만드는 이유를 이해하세요. 브라우저에서 직접 실행하는 실습 코드로 Apache Kafka & Stream Processing Fundamentals을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
Apache Kafka & Stream Processing Fundamentals을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 Apache Kafka & Stream Processing Fundamentals은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 4번째 강의입니다.
“커밋 로그: Kafka의 데이터 저장 방식” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 Apache Kafka & Stream Processing Fundamentals 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 Apache Kafka & Stream Processing Fundamentals 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- Apache Kafka란 무엇인가요?
- Kafka 핵심 개념: 브로커와 토픽
- Kafka 로컬 환경 설정
- 커밋 로그: Kafka의 데이터 저장 방식