Cloud

Building block · 8 min

Event streams

Kinesis, MSK, Pub/Sub, Managed Kafka and Event Hubs: when you need a log, and which one.

An event stream is a log: producers append records, records stay for a set time whether or not anyone has read them, and every consumer keeps its own position. That one difference from a queue changes what you can build. Many teams read the same history at their own pace, a new consumer can start from last week, and a bug fix can be replayed over yesterday's data. How Kafka works and Consumer groups teach the model; this page is about which managed log to rent, or whether to run your own.

The options split into two families. Kafka-compatible services (Amazon MSK, Google Cloud's Managed Service for Apache Kafka, Azure Event Hubs through its Kafka endpoint, and self-run Kafka or Redpanda) speak the Kafka protocol, so your clients and tools move with you. Cloud-native streams (Kinesis Data Streams, Pub/Sub, Event Hubs' own protocol) are simpler to start and priced differently, but tie your code to one cloud.

Side by side

AWS Google Cloud Azure Self-hosted
Kafka protocol MSK: Provisioned (Standard or Express brokers) or Serverless Managed Service for Apache Kafka Event Hubs Kafka endpoint (Standard tier and above) Apache Kafka, Redpanda
Cloud-native stream Kinesis Data Streams Pub/Sub Event Hubs
Unit of scale Shard: 1 MB/s or 1,000 records/s in, 2 MB/s out No partitions to size; ordering keys capped at 1 MB/s each Throughput unit: 1 MB/s or 1,000 events/s in, 2 MB/s out Brokers and partitions you size
Longest retention 365 days (24 hours by default) 31 days on a topic 7 days on Standard, 90 on Premium and Dedicated Unlimited, with tiered storage
Compacted topics No No Yes (sizes by tier) Yes
You pay per Shard-hour, or GB on on-demand Throughput and retained storage Throughput, processing or capacity unit per hour Machines, disks, cross-zone traffic and people