Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cloud Native Kafka - KIP-405、KIP-500、及び関連KIPについて

hashi
January 14, 2022

Cloud Native Kafka - KIP-405、KIP-500、及び関連KIPについて

Cloud Native Database Meetup Japan #3 LT

KubernetesでKafkaを運用するのではなく、Kafka自体がCloud Nativeになる為には?KIP-405、KIP-500を始めとした、KafkaのCloud Native化に関する改善について駆け足でご説明します。

hashi

January 14, 2022
Tweet

More Decks by hashi

Other Decks in Technology

Transcript

  1. Cloud Native Database Meetup Japan #3 LT Cloud Native Kafka

    - KIP-405、KIP-500、及び関連KIPについて Shinichi Hashitani, Solutions Engineer, Jan-17, 2021. #CloudNativeDB
  2. Kafka itself becoming “Cloud Native”. Meaning, Kafka is more: -

    Architecturally Simple - Scalable - Tolerable to runtime failures
  3. Copyright 2021, Confluent, Inc. All rights reserved. This document may

    not be reproduced in any manner without the express written permission of Confluent, Inc. How Kafka is used in the real world 9 Durable Asynchronous Messaging 非同期通信によるイベント駆動モデル - KafkaはPullモ デル。Brokerがメッセージを長期保存出来るのでバッ クプレッシャー不要。 CQRS with Change Data Capture CRUD処理と参照 (検索) 処理を異なるサービス/スト レージで提供。異なるストレージ (e.g. RDBMSからサー チエンジン)間でデータを同期。 Command Query
  4. Copyright 2021, Confluent, Inc. All rights reserved. This document may

    not be reproduced in any manner without the express written permission of Confluent, Inc. Kafka Keeps Data Consistent 10 customer login: abc order confirmed: #001 order updated: #002 customer login: efg order canceled: #003 Append-Only Immutable 1 2 3 4 5 6 8 7 10 9 11 12 1 2 3 4 5 6 8 7 Old New
  5. Copyright 2021, Confluent, Inc. All rights reserved. This document may

    not be reproduced in any manner without the express written permission of Confluent, Inc. Kafka Is a Durable Storage 11 Broker 1 Topic1 partition1 Broker 2 Broker 3 Broker 4 Topic1 partition2 Topic1 partition3 Topic1 partition4 Topic1 partition1 Topic1 partition1 Topic1 partition2 Topic1 partition2 Topic1 partition3 Topic1 partition3 Topic1 partition4 Topic1 partition4
  6. Copyright 2021, Confluent, Inc. All rights reserved. This document may

    not be reproduced in any manner without the express written permission of Confluent, Inc. Segment 1 Segment 2 KIP-405 - Kafka Tiered Storage 16 KIP-405: Kafka Tiered Storage Segment 1 Segment 2 Segment 3 Active Segment Segment 1 Segment 2 Write Read Read Offset = earliest • ComputeとStorageの密結合 • 高速 - Disk I/O • ログ保全コスト大 • 障害時 - 大量データのリバランス • ComputeとStorageの分離 • 低速 - Network I/O • ログ保全コスト小 • 障害時 - 限定的なデータのリバランス
  7. Copyright 2021, Confluent, Inc. All rights reserved. This document may

    not be reproduced in any manner without the express written permission of Confluent, Inc. KIP-500 - Replace Zookeeper with a Self-Managed Metadata Quorum 18 KIP-500: Replace Zookeeper with a Self-Managed Metadata Quorum • 別途Zookeeperクラスタ必要 • Zookeeperで合意形成 • Controllerがメタデータ提供 ZK ZK ZK • 別途Zookeeperクラスタ不要 • Controllerx3+で合意形成 • Controllerがメタデータ提供
  8. Copyright 2021, Confluent, Inc. All rights reserved. This document may

    not be reproduced in any manner without the express written permission of Confluent, Inc. KIP-595 - A Raft Protocol for Metadata Quorum 19 • メタデータ合意 (Leader/Follower) • Leader Election KIP-595: A Raft Protocol for Metadata Quorum メタデータの永続化ストアからログベースへ 元々Kafkaはユーザーデータ/メタデータのそれぞれ をログベースで行っており、Raftモデルとの親和性は 高い。メタデータは内部Topic __cluster_metadata にて管理。スナップショットとTopicを利用して迅速 にメタデータを復旧。
  9. Copyright 2021, Confluent, Inc. All rights reserved. This document may

    not be reproduced in any manner without the express written permission of Confluent, Inc. KIP-630 - Kafka Raft Snapshot 20 KIP-630: Kafka Raft Snapshot 0からのState復旧 Controllerはメタデータログから状態 (State) を更新 しメモリに保存、合わせて永続化している。この Metadata Stateを再現する為にはログが必要だが、 ログは絶えず増えState再現にかかる時間も比例的に 増大する。 Active Controllerはあるコミットされた状態で定期 てにMetadata Storeのスナップショットを取得。 新たに参加 (新規/復旧) する新しいControllerはス ナップショットを始点として必要なオフセットからメ タデータログを消化しStateを再現する。