Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path →
Kafka vs Kinesis: portable log, or zero-ops AWS stream?
Underneath, they're the same idea — an append-only, partitioned log that consumers read at their own pace. The real choice isn't about the streaming model at all. It's about who operates it, and whether you're willing to live inside AWS to get out of doing that yourself.
The one distinction that decides everything
Kafka is open-source software you run yourself (or via a managed offering like Confluent or Amazon MSK) — a distributed, partitioned, replicated log, portable across any cloud or on-prem. Kinesis is AWS's fully-managed streaming service, built on the same append-only log idea but organized into shards instead of partitions, and it exists only inside AWS.
Need to run outside AWS, want the biggest ecosystem, or need very long/infinite retention? Kafka. Already all-in on AWS and want zero operational burden? Kinesis.
Head to head
| Dimension | Kafka | Kinesis |
|---|---|---|
| Management | You run/tune brokers (or a managed offering) | Fully AWS-managed, zero ops |
| Lock-in | Portable — any cloud, on-prem | AWS-only |
| Scaling unit | Partitions, very high throughput ceiling | Shards, provisioned or on-demand |
| Per-unit throughput | Tunable, generally high | Fixed: 1MB/s in, 2MB/s out per shard |
| Retention | Configurable, can be near-infinite (tiered storage) | Default 24h, up to 365 days at extra cost |
| Cost model | Infra/ops cost — cheaper at massive self-run scale | Pay-per-shard-hour + PUT/GET — cheap to start |
| Ecosystem | Huge — Connect, Streams, ksqlDB, Flink | Tight AWS integration — Lambda, Firehose, Analytics |
| Multi-cloud | Yes | No |
When to use each
Reach for Kafka
- Multi-cloud or on-prem requirements
- Need long retention / full replay of history
- Want the largest streaming ecosystem and tooling
- Already run dedicated ops/platform teams
- Extreme throughput on a single hot stream
Reach for Kinesis
- Already all-in on AWS
- Want zero operational burden
- Need tight Lambda / Firehose / Analytics integration
- Smaller team without dedicated streaming ops
They’re substitutes, not complements
Unlike RAG-and-fine-tuning or MCP-and-A2A, you don't typically run both in the same pipeline — pick one streaming backbone. The existence of Amazon MSK (managed Kafka, running on AWS) is itself telling: it's AWS acknowledging that some teams want Kafka's specific model and ecosystem even while staying on AWS, rather than Kinesis's shard model, which shows this is a genuine architectural trade-off and not just "AWS vs not-AWS."
Moving between them is more of an ops/infrastructure decision than an architecture rewrite — both are the same log-and-offset model underneath — but Kinesis's hard per-shard throughput ceiling can force a re-architecture Kafka's tunable partitions wouldn't have.
Same log model, different hard limits
Both systems implement the same core idea: an append-only, partitioned log where consumers track their own read position (offset in Kafka, sequence number in Kinesis) and can replay by resetting it. That means the semantic guarantees — ordered delivery within a partition/shard, at-least-once consumption, replay from any retained point — are essentially the same on both. The difference that actually bites in practice is the throughput ceiling per unit: a Kafka partition's throughput is tunable and can be pushed very high by adjusting broker resources, while a Kinesis shard has a hard, fixed limit of 1MB/s in and 2MB/s out, full stop, regardless of what you're willing to pay for bigger hardware.
This matters specifically for "hot key" streams — if one partition key (say, one very active user or one very busy IoT device) needs to sustain more than 1MB/s, Kinesis forces you to solve it with application-level key-splitting tricks, because there's no "just make this shard bigger" option the way there effectively is with a Kafka partition on beefier hardware. It's a small-sounding limit that becomes a real architecture constraint at the tail of a workload's traffic distribution.
Kinesis trades away Kafka's tunable per-partition ceiling for the operational simplicity of never having to tune a broker — fine until one shard's traffic wants to exceed a hard-coded number.
A worked scenario: a clickstream analytics pipeline
An analytics team already runs Lambda consumers, streams to S3 via Firehose, and visualizes in QuickSight — all AWS-native. Kinesis fits this pipeline directly: no brokers to run, and the integration points (Lambda triggers, Firehose delivery) are first-class, managed features rather than something to wire up manually. The zero-ops story is a genuine win when the rest of the stack is already this AWS-native.
The same pipeline, if it also needs to feed an on-prem fraud-detection cluster today, or needs to stay portable for a possible multi-cloud future, points to Kafka instead — the portability isn't a nice-to-have here, it's the actual requirement Kinesis structurally can't satisfy, since it doesn't run outside AWS at all. The right call depends entirely on whether "stay inside AWS" is a real constraint or an assumption worth questioning before committing.
The decision is rarely about which system streams data better — it’s whether staying inside one cloud’s walls is a feature (less ops) or a constraint (less portability) for this specific team.
The flip point: the throughput where the cost crosses over
Kinesis bills per shard (fully managed, no ops); self-managed Kafka is a fixed cluster cost plus your engineers’ time. If a shard costs P per hour and a Kafka cluster costs M per hour, Kinesis is cheaper below M / P shards, and Kafka’s fixed cost amortizes above it.
Plugging in example figures — a shard at P = $0.015/hour and a small cluster at M = $1.50/hour — the crossover is 1.50 / 0.015 = 100 shards ≈ 100 MB/s of ingest. Below that, Kinesis’s pay-per-shard is cheaper and spares you running Kafka; above it, the fixed cluster wins. Crucially, M should include the on-call engineers who operate Kafka — folding that in pushes the crossover well past 100 shards, which is why “start with the managed one” holds until you are genuinely at scale. Use your provider’s real shard price and your true cluster cost; the crossover is just their ratio.
The picture: keys, partitions and one consumer each
Worked example: sizing a 6 MB/s clickstream
A clickstream averages 6 MB/s in, with 2 KB records, and two separate apps read all of it. Each consumer instance can process 1.5 MB/s. These workload numbers are illustrative; the shard limits are Kinesis’s documented ones. Size both systems.
| Step | Question | Arithmetic | Answer |
|---|---|---|---|
| 1 | Records per second | 6 MB/s ÷ 2 KB (1 MB = 1,000 KB here) | 3,000 records/s |
| 2 | Kinesis shards for bytes | 6 MB/s ÷ 1 MB/s per shard | 6 |
| 3 | Kinesis shards for records | 3,000 ÷ 1,000 records/s per shard | 3 |
| 4 | Shards to provision | the larger of 6 and 3 | 6 |
| 5 | Read headroom, two apps sharing reads | 2 × 6 = 12 MB/s out, against 6 × 2 = 12 MB/s | 100%: no headroom at all |
| 6 | Provision 8 shards instead | writes 6 ÷ 8; reads 12 ÷ 16 | 75% each |
| 7 | Kafka consumers per app | 6 ÷ 1.5 | 4, so at least 4 partitions |
| 8 | Kafka partitions for 3× growth | 18 ÷ 1.5 | 12, chosen now, not later |
| 9 | One device sends 1.6 MB/s | 1.6 > 1 shard cap; 1.6 > 1.5 per consumer | Kinesis throttles it; on Kafka its one consumer falls behind |
Step 5 is the trap. Six shards are enough for writes but leave zero read headroom, so any burst or third reader means throttled reads. Enhanced fan-out fixes that by giving each registered consumer its own 2 MB/s per shard, billed separately. Step 8 is chosen up front because adding Kafka partitions later changes hash(key) mod n, and a key’s records end up split across two partitions. Step 9 is the honest version of the page’s “hot key” warning. Kafka removes the broker-side cap, but not the rule that one partition goes to one consumer. On both systems the fix is the same: salt the key (dev-7#0 to dev-7#3), spread it over four partitions and re-combine downstream, giving up strict per-device order.
Cost and trade-offs: scaling, fan-out and replay
Here Time means the effort or wait to make the change. Space means the capacity or storage it gives you or costs you.
| Case | Time | Space | Why |
|---|---|---|---|
| Kinesis: more write capacity | An API call: split a shard, or UpdateShardCount | +1 MB/s in and +2 MB/s out per shard | A key’s hash range moves to child shards. Consumers finish the parent before the children, so per-key order holds. |
| Kafka: more write capacity | Adding partitions is quick; adding brokers means a reassignment that copies data | Limited by broker disk, network and replication factor | New partitions change hash(key) mod n, so existing keys can move. |
| Kinesis: one more reading app | Nothing to set up | Shares 2 MB/s per shard with every other app, or gets its own 2 MB/s with enhanced fan-out | At the full 1 MB/s write rate, two shared readers already use the whole 2 MB/s. |
| Kafka: one more consumer group | Nothing to set up | Reads the same log; costs broker network out | Recent data is usually served from the OS page cache, so extra readers are cheap. |
| Kinesis: replay | Start an iterator at a timestamp or sequence number | 24 h by default, up to 365 days at extra cost | Anything older than retention is gone. Archive to S3 if you need more. |
| Kafka: replay 90 days | Reset the group’s offsets to a timestamp | 6 MB/s × 90 days × replication 3 ≈ 140 TB of disk | Tiered storage moves old segments to object storage to make this affordable. |
| Latest value per key | Kafka: a compacted topic | Grows with distinct keys, not with time | Kinesis has no compaction. Keep that table somewhere else. |
The pattern: Kinesis gives you capacity in fixed slices that you add with an API call, and every limit is stated up front. Kafka gives you knobs (partitions, brokers, retention, compaction), and each knob has a cost you have to know about, such as remapped keys or disk multiplied by the replication factor.
Common mistakes
- Sizing Kinesis on bytes alone
A shard takes 1 MB/s or 1,000 records/s, whichever you hit first. At 200-byte records, 1 MB/s is 5,000 records/s, which needs 5 shards, not 1. Aggregate small records into larger ones (the KPL does this) or size on the record count.
- Too few Kafka partitions
A consumer group can use at most as many consumers as there are partitions. Start with 4 and you can never run a 5th consumer. Add partitions later and keyed data gets remapped. Pick the count for the throughput you expect, as in step 8 above.
- A low-cardinality partition key
Keying by country, tenant or event type puts your biggest customer, or the most common event, on one partition. Pick a key with many values that still keeps together the records that need ordering, such as an order id rather than a merchant id.
- Expecting a global order
Order is guaranteed only within one partition or shard. Two events for different keys can be read in either order, and after a reshard or rebalance often are. If you need order across keys, they must share a key, and therefore share a partition’s throughput.
- Assuming no duplicates
Both deliver at least once. A producer retries after a timeout and writes twice, and a consumer crashes after processing but before saving its offset or checkpoint, so the batch is re-read. Make consumers idempotent with an event id. Kafka’s idempotent producer and transactions cover read-process-write inside Kafka, not your database.
Where this shows up in production and interviews
- Change data capture
Debezium streams database changes into Kafka topics, keyed by primary key so every row’s changes stay in order. A compacted topic then holds the latest version of every row, which a new service can read from the beginning to rebuild a full copy.
- Lambda on Kinesis
An event source mapping processes each shard in order, with one batch in flight per shard by default. The parallelization factor (up to 10) splits a shard across concurrent invocations while keeping each partition key in order. Shard count still sets the ceiling.
- Lag is the alert
The health metric on both is how far behind consumers are: consumer-group lag in offsets on Kafka, iterator age on Kinesis. Lag that keeps rising is a consumer slower than its partition, which is the hot-key failure from step 9.
- The interview version
In “design a metrics or clickstream pipeline”, do the step 1 to 4 arithmetic out loud. Then name your partition key and what it orders, say what happens when one key goes hot, and say how consumers stay idempotent under redelivery. Interviewers care much more about that than about which product you name.
Which would you pick?
Three situations. Pick the side you'd actually build — the explanation follows.
A team is entirely on AWS, has no platform engineers to spare, and wants a stream with minimal operational burden.
With no one to operate it, the operational burden *is* the deciding constraint, and that is what Kinesis removes. Self-managing Kafka hands that burden to a team that does not have it, and a larger ecosystem is worth little if nobody is available to run the cluster.
One partition's traffic is projected to grow past a single shard's hard throughput limit.
Adding shards raises aggregate throughput but not what a *single* shard can take, so a hot key that exceeds one shard's hard-coded ceiling stays stuck. Kafka's equivalent limit is something you can tune. This is the specific case where the managed service's simplicity turns into a wall.
How should a team frame the choice between the two?
Both are the same log-and-offset model underneath, so "which streams better" has no useful answer. The page reframes it as an ops-and-portability question: less operational work versus less portability. Cost per GB is one input to that, not a substitute for it.
Quick answers
Kafka or Kinesis — which should I use?
If you’re already all-in on AWS and want zero operational burden, Kinesis. If you need multi-cloud portability, very long retention, or the largest streaming ecosystem, Kafka (self-run or via managed Kafka like Amazon MSK).
Are Kafka and Kinesis the same underlying model?
Yes — both are an append-only, partitioned log where consumers track their own read position and can replay history. The real differences are operational surface, ecosystem, and hard scaling limits, not the core streaming semantics.
What’s the practical limit that catches teams off guard with Kinesis?
Each shard has a hard, fixed throughput ceiling — 1MB/s in, 2MB/s out — that no amount of extra spend removes. A single very hot partition key can hit this limit in a way a tunable Kafka partition typically wouldn’t.
Can you run Kafka on AWS and get managed simplicity?
Yes — Amazon MSK is managed Kafka running on AWS, giving you Kafka’s model and ecosystem with reduced operational burden, for teams that want Kafka specifically but still prefer not to run brokers themselves.
Explore the topic
See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.
More Handbooks
- The Kafka HandbookApache Kafka as a distributed append-only log, not a queue — topics, partitions and offsets, producers, consumers and consumer groups, per-key ordering, replication and ISR, delivery semantics (at-least-once and exactly-once), retention vs log compaction, and when Kafka beats a message queue.Read →
- Kafka vs RabbitMQThey both "move messages", which is exactly why teams pick the wrong one. Kafka is a durable, replayable log where consumers track their own offset; RabbitMQ is a smart broker that routes each message and deletes it on ack. The remember-vs-forget core difference, throughput and ordering trade-offs, and how to choose.Read →
- The WebSockets & Real-Time HandbookWhy "live" is hard on a protocol that can't push. Polling makes you wait on average half the interval to learn of an event (a 10s poll = ~5s staleness) and wastes a request every time nothing changed — and shrinking the interval only multiplies the waste. A WebSocket keeps one persistent full-duplex line open so the server pushes the instant something happens: latency ≈ one network hop, zero empty requests. The poll-vs-push latency math, when to use SSE instead, and the stateful-scaling pitfalls. With worked math and runnable code.Read →
- REST vs Webhooks vs SSEThree ways client and server move data, split by who exposes an endpoint and whether the connection stays open: REST pulls, webhooks flip who runs the server, SSE keeps one connection open for a live push. How real systems run all three at once.Read →
- Streaming vs BatchBatch processes on a schedule; streaming reacts per-event. The real engineering cost of streaming isn’t speed, it’s correctness under disorder — event time vs processing time, watermarks, exactly-once semantics. The Lambda and Kappa architectures that combine both.Read →
- LLM API PricingEvery major provider’s API pricing in one comparable table, per million tokens — Anthropic Claude, OpenAI GPT, Google Gemini — pulled from official docs on 2026-07-21, not aggregators. Batch and prompt-caching discounts, a cross-provider tier map, and a fully worked chatbot cost example.Read →