Choose AWS streaming and data warehouse services
Compare Kinesis, Amazon MSK and Redshift for a scenario on replay, schema evolution and cost.
By Invicly Tech, , in AWS Cloud Engineering. About 12 minutes to read.
In short
Streaming services move events continuously and let consumers read them in order, while a data warehouse stores cleaned data for fast analytical SQL. On AWS the main streaming choices are Amazon Kinesis Data Streams and Amazon MSK (managed Apache Kafka), and the main warehouse is Amazon Redshift. The right pick depends on how far back you must replay, how your event schema will change, the skills on your team and what you will pay while idle.
Explained simply
A queue like SQS hands each message to one worker and deletes it once it is processed. A stream works differently. Every event is written to an ordered log and kept for a set time. Many different consumers can read the same log, each at its own pace, and any of them can go back and read it again. That ability to re-read is called replay.
AWS gives you two main streaming services. Amazon Kinesis Data Streams is an AWS-native service you call with the AWS SDK and secure with IAM. Amazon MSK runs Apache Kafka for you, so any Kafka client or connector works. Both split a stream into parts (shards in Kinesis, partitions in Kafka) so it can grow, and both keep events in order within each part.
A data warehouse is a different tool for a different job. Amazon Redshift stores large tables in a columnar format and answers analytical SQL quickly: joins, aggregates and dashboards over months of data. Streams move events now; the warehouse answers questions later. A common pipeline sends a stream into S3 or straight into Redshift, then analysts query the warehouse.
Choosing well means asking a few plain questions. How far back might you need to replay? Will the event format change, and who reads old events? Does the team already know Kafka? What does the option cost when nothing is happening? The answers usually point to one option clearly.
Cost note: Kinesis, MSK and Redshift all bill by the hour in provisioned modes, and even on-demand or serverless modes have charges. For a lab, run Apache Kafka locally in Docker and use DuckDB or PostgreSQL as a stand-in warehouse, then do a design-only comparison for the AWS services.
Press Play on a diagram to walk through it one step at a time.
- AWS-native API, IAM auth
- Shards or on-demand capacity
- Retention 24 hours by default, up to 365 days
- Good fit for Lambda consumers
- Standard Apache Kafka APIs
- Provisioned brokers or MSK Serverless
- Retention set per topic
- Good fit for existing Kafka tools
- Columnar SQL warehouse
- Provisioned clusters or Redshift Serverless
- Loads from S3 and streams
- Good fit for dashboards and joins
- Each message handled once
- Amazon SQS
- No replay after delete
- Many readers and replay
- Kinesis Data Streams
- Amazon MSK
- Deliver a stream to storage
- Amazon Data Firehose
- Writes to S3, Redshift and more
- Transform events in flight
- Managed Service for Apache Flink
- Lambda for simple cases
- Analytical SQL over history
- Athena on the lake
- Redshift for heavy dashboards
In depth
Kinesis Data Streams and MSK compared in detail
Kinesis Data Streams has two capacity modes. In provisioned mode you choose a shard count; each shard accepts up to 1 MB/s or 1,000 records/s of writes and serves 2 MB/s of reads shared by standard consumers. Enhanced fan-out gives a consumer its own 2 MB/s per shard. In on-demand mode Kinesis scales shards for you and you pay per GB plus a per-stream charge. Lambda can read a stream directly through an event source mapping. Amazon MSK gives you real Kafka: topics, partitions, consumer groups and the Kafka Connect ecosystem. Provisioned MSK means you pick broker types and storage; MSK Serverless removes broker sizing but has its own quotas. Kafka gives more control over retention, compaction and client tuning, at the price of more concepts to learn.
- Order is kept per shard or partition, chosen by partition key
- Kinesis auth: IAM; MSK auth: IAM, SASL/SCRAM or TLS
- Kafka log compaction keeps the latest event per key
- Both can feed Lambda, Flink and S3
Replay: retention windows and consumer positions
Replay works because consumers, not the stream, track their position. In Kinesis, a consumer reads with a shard iterator such as TRIM_HORIZON (oldest available), LATEST, AT_SEQUENCE_NUMBER or AT_TIMESTAMP. Retention is 24 hours by default and can be raised up to 365 days, with extra charges beyond the default. In Kafka, each consumer group stores committed offsets, and you can reset a group to an earlier offset or timestamp with the kafka-consumer-groups tool. Replay is only safe when the consumer is idempotent: writing the same result twice must give the same end state. In our file service, a DynamoDB conditional write on file_id makes replayed events harmless.
- 1Spot bad results
Alarm on error rate at 14:00
- 2Deploy the fix
Consumer v2 passes tests
- 3Reset position
AT_TIMESTAMP 08:00 or reset Kafka offsets
- 4Reprocess
Idempotent writes overwrite bad results
- 5Verify
Counts match source for 08:00 to 14:00
Planning for schema evolution
Events live longer than code. If you replay a week of events, the new consumer reads old shapes; if a producer upgrades first, old consumers read new shapes. Backward compatible means new readers can read old data; forward compatible means old readers can read new data. Safe changes: add an optional field with a default, or stop sending a field readers already treat as optional. Unsafe changes: rename a field, change its type, or make an optional field required. A schema registry enforces this. AWS Glue Schema Registry supports Avro, JSON Schema and Protobuf and works with both Kinesis and MSK; many Kafka teams also use a Confluent-compatible registry. Put a schema version number in each event so consumers can branch when they must.
- Add fields as optional with defaults
- Never rename or retype in place; add a new field instead
- Version the event: schema_version: 2
- Test consumers against stored old events before replaying
Where Redshift fits and what it costs
Redshift is a columnar, massively parallel SQL warehouse. Data usually arrives with COPY from S3, through Amazon Data Firehose, through streaming ingestion from Kinesis or MSK into a materialized view, or through zero-ETL integrations from some AWS databases. Redshift Spectrum can also query files in S3 through the Glue Data Catalog without loading them. Redshift Serverless bills per RPU-hour while it is processing work, plus storage; provisioned RA3 clusters bill per node-hour whether busy or not. Choose Redshift when many users run repeated, complex queries and dashboards over large joined data. For occasional ad hoc queries on a lake, Athena is often cheaper; for per-event logic, use a stream consumer instead.
Learn it in 5 short steps
About 30m each. Track them with a timer in your plan.
- 1Compare Kinesis Data Streams and MSK~30m
- 2Replay from a retention window~30m
- 3Plan for schema changes~30m
- 4Place Redshift for warehousing~30m
- 5Estimate cost per option~30m
Key points
- A stream keeps events for a retention window, so a fixed consumer can re-read from an earlier position.
- Kinesis suits teams that want an AWS-native service; MSK suits teams that already speak Kafka.
- Plan schema changes up front: add optional fields, never rename or retype fields in place.
- Redshift is for analytical queries over large, cleaned data sets, not for per-event processing.
- Count the idle cost: provisioned shards, brokers and clusters bill every hour, even with no traffic.
Key terms
Tap a card to flip it. 0/6 known
Examples
Choosing a stream for file-status events
Scenario: the file service emits about 50 status events per second. Three consumers need them: a live dashboard, an audit archive and a fraud check. The team knows AWS but not Kafka, and must be able to replay 7 days. Step 1: rule out SQS, because three independent readers and replay are needed. Step 2: compare Kinesis and MSK. 50 small events per second fit one shard. Step 3: retention of 7 days is supported by Kinesis with extended retention. Step 4: no Kafka skills or tools exist. Decision: Kinesis Data Streams in on-demand mode, with Firehose writing to S3 for the archive. Revisit MSK if Kafka connectors become a need.
Replay events from a timestamp in Kinesis
A consumer bug wrote wrong sizes from 08:00 UTC. After deploying the fix, you read the stream again from that time. Prerequisite: the window is within the retention period. The commands below get an iterator for one shard and read a batch; a real consumer (KCL or Lambda with a starting position of AT_TIMESTAMP) loops over all shards. Evidence: records with ApproximateArrivalTimestamp at or after 08:00. Cleanup: delete the lab stream, because on-demand streams also bill per hour.
aws kinesis list-shards --stream-name file-events
IT=$(aws kinesis get-shard-iterator \
--stream-name file-events \
--shard-id shardId-000000000000 \
--shard-iterator-type AT_TIMESTAMP \
--timestamp 2026-12-01T08:00:00Z \
--query ShardIterator --output text)
aws kinesis get-records --shard-iterator "$IT" --limit 25
# lab cleanup
aws kinesis delete-stream --stream-name file-eventsQuick reference
- Kinesis shard: 1 MB/s or 1,000 records/s in, 2 MB/s out (shared unless enhanced fan-out).
- Kinesis retention: 24 hours by default, extendable up to 365 days at extra cost.
- Replay in Kinesis with AT_TIMESTAMP or TRIM_HORIZON; in Kafka, reset consumer group offsets.
- Order is guaranteed only within one shard or partition; choose the partition key carefully.
- Safe schema change: add an optional field with a default. Unsafe: rename, retype, make required.
- Amazon Data Firehose delivers streams to S3 or Redshift without writing a consumer.
- Redshift Serverless bills per RPU-hour while working; provisioned clusters bill per node-hour.
- Lab alternative: Kafka in Docker plus DuckDB or PostgreSQL as the warehouse.
Common mistakes
- Choosing a stream when a simple SQS queue would do: queues delete messages once processed and have no replay.
- Using a low-variety partition key, so one hot shard throttles while others sit idle.
- Leaving a provisioned MSK cluster or Redshift cluster running after a lab.
Quick quiz
Pick an answer to see if you're right and why.
Practice exercises
Try each one yourself first. Use the hint if you get stuck, then compare with the solution.
- Exercise 1easy
For the file service, write down whether each need is better served by SQS, a stream or a warehouse: resize each image once; three teams read every status event; monthly failure report.
- Exercise 2medium
Run Kafka locally, produce three events, consume them, then replay from the beginning with a new consumer group.
- Exercise 3hard
Write a one-page decision record comparing Kinesis on-demand, MSK Serverless and provisioned MSK for 2,000 events per second, 14-day replay and a team with Kafka experience. Include idle cost.
Check yourself
Answer in your head, reveal, then be honest with yourself.
Feel confident about this topic?
Frequently asked questions
- What is the difference between Kinesis Data Streams and Amazon Data Firehose?
- Data Streams is a stream you read with your own consumers and can replay. Firehose is a delivery service that buffers incoming data and writes it to destinations such as S3 or Redshift, with no replay of its own.
- Is Kafka better than Kinesis?
- Neither is better in general. Kafka offers more control and a large ecosystem; Kinesis is simpler to run if you are already all-in on AWS. Choose based on team skills, tools and cost.
- Do I need Redshift if I already have Athena?
- Often not at first. Athena is fine for occasional queries on S3. Redshift pays off when many users run frequent, complex queries and need steady, fast dashboards.