2022-09-24 Kafka 存儲設計

學習資料

1.https://thehoard.blog/how-kafkas-storage-internals-work-3a29b02e026

2.https://www.conduktor.io/understanding-kafkas-internal-storage-and-log-retention


整體設計

Role of Indexing within the Partition

How these entries are added inside the index file is defined by thelog.index.interval.bytesparameter, which is 4096 bytes by default. This means that after every 4096 bytes added to the log, an entry gets added to the index file. Suppose the producer is sending records of 100 bytes each to a Kafka topic. In this case, a new index entry will be added to the .index file after every 41 records (41*100 = 4100 bytes) appended to the log file.

基于offset找消息
基于時間找消息

Rolling segments

Maximum segment size - configured bylog.segment.bytes, defaults to 1 Gb

Rolling segment time - configured bylog.roll.msandlog.roll.hours, defaults to 7 days

Index/timeindex is full - The index and timeindex share the same maximum size, which is defined by the** log.index.size.max.bytes**, defaults to 10 MB

?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容