Skip to main content
Cloud / AWS / Products / Amazon Kinesis - Real-time Data Streaming

Amazon Kinesis - Real-time Data Streaming

Amazon Kinesis enables real-time data streaming and analytics at scale. Process millions of events per second with sub-second latency.

Analytics
Pricing Model Pay per shard hour and data
Availability All major regions
Data Sovereignty EU regions available
Reliability 99.9% availability SLA

What is Amazon Kinesis?

Amazon Kinesis is a family of fully managed services for processing streaming data in real-time. Kinesis enables ingestion, processing, and analysis of continuous data streams with sub-second latency at any scale.

The Kinesis family includes four services: Kinesis Data Streams (core streaming platform), Kinesis Data Firehose (managed data delivery), Kinesis Data Analytics (SQL and Apache Flink for stream processing), Kinesis Video Streams (video ingestion and processing).

Kinesis is available in all EU regions for GDPR-compliant data processing. The service offers 99.9% availability SLA and scales automatically from MBs to TBs per second.

How Does Kinesis Data Streams Work?

Kinesis Data Streams is the core streaming platform. Producers send data (records) to streams, consumers read data in parallel. Each record consists of a partition key, sequence number, and data blob (up to 1 MB).

Stream Architecture

Shards: Parallelization units. Each shard: 1 MB/s write, 2 MB/s read (standard) or 2 MB/s per consumer (Enhanced Fan-Out). Streams scale by increasing shard count.

Partition Key: Determines shard assignment via hash. Records with the same partition key land on the same shard (ordering guaranteed). Use high-cardinality keys for even distribution.

Retention: Default 24 hours, configurable up to 365 days. Data is replayable within the retention period. Consumers can read the stream from any point within their retention window.

Provisioned vs. On-Demand Mode

Provisioned: Manual shard configuration. Predictable costs, full control. Shard splitting/merging for adjustments. More cost-effective at consistent load.

On-Demand: Automatic sharding based on workload. Pay-per-GB. Scales from 0 to 200 MB/s write (4,000 shards). Ideal for variable or unpredictable workloads. Higher costs at consistently high load.

Kinesis Data Firehose

Firehose is fully managed: No shards, no consumer management. Automatic batching, compression (Gzip, Snappy, Zip), format conversion (JSON to Parquet). Direct delivery to S3, Redshift, OpenSearch, Splunk, custom HTTP endpoints.

Latency: 60-second buffer (near-real-time). Transformations via Lambda possible. Ideal for simple ETL pipelines without custom consumer logic.

Typical Use Cases for Amazon Kinesis

Real-time Clickstream Analysis

E-commerce websites stream clickstream data (clicks, views, purchases) to Kinesis. Lambda or Kinesis Data Analytics processes events in real-time: user segmentation, product recommendations, conversion tracking.

Output to DynamoDB for personalization, S3 for long-term analysis, OpenSearch for dashboards. Sub-second latency from click to action. Scales to millions of events per second during Black Friday.

Log Aggregation and Monitoring

Applications stream logs to Kinesis Firehose. Firehose batches, compresses, and delivers to S3 (cost-effective long-term storage) or OpenSearch (real-time search and alerting).

Lambda transformations filter sensitive data (PII), extract metadata, convert formats. CloudWatch Logs Subscription Filters automatically send logs to Kinesis. Centralized logging for multi-account AWS Organizations.

IoT Telemetry Processing

IoT devices (sensors, vehicles, smart home) send telemetry data to Kinesis. Millions of devices, billions of events daily. Kinesis Data Streams with On-Demand mode scales automatically.

Lambda processes events: anomaly detection (temperature spikes), aggregation (hourly averages), event routing (alerts to SNS). Kinesis Data Analytics for windowed aggregations (sliding averages over 5 minutes).

Real-time ETL for Data Lakes

Streaming ETL pipeline: Kinesis Data Streams as ingestion layer, Lambda for transformations, Firehose for delivery to S3 Data Lake. Format conversion from JSON to Parquet for Athena/Glue queries.

Partitioning by date, compression (Parquet), deduplication. Athena queries data minutes after ingestion. Cost-optimized through Parquet (10x smaller files, 10x faster queries vs. JSON).

Event Sourcing and CQRS

Kinesis Data Streams as event store for event sourcing architectures. All state changes persisted as events (up to 365 days retention). Lambda consumers build read models (materialized views) from the event stream.

Replayable: On code changes, restart consumers from the beginning of the stream to regenerate read models. Lambda error? Reset iterator position, replay since last success. CQRS pattern with separate read/write models.

Best Practices for Amazon Kinesis

1. Choose the Right Kinesis Service

Data Streams: For custom processing logic, real-time (<200ms), multiple consumers, replay capability. More complex, more flexible.

Data Firehose: For direct-to-storage, near-real-time (60s acceptable), simple batching. Simpler, less flexible.

Data Analytics: For SQL-based stream processing, windowed aggregations, real-time dashboards.

Hybrid: Data Streams as backbone, Firehose for delivery branches, Analytics for real-time insights.

2. Optimize Partition Key Distribution

Partition key determines shard assignment. Goal: Even distribution across all shards.

Good: User ID (high cardinality), Device ID, Transaction ID
Bad: Region (low cardinality, few values), Timestamp (hot shard at current time), Constant value (everything on one shard)

CloudWatch Metric IncomingBytes per shard shows uneven distribution. Use Kinesis Data Generator for testing.

3. Use Enhanced Fan-Out for Multiple Consumers

Standard: All consumers share 2 MB/s per shard (GetRecords polling). With 3 consumers: <700 KB/s per consumer, higher latency.

Enhanced Fan-Out: Each consumer gets dedicated 2 MB/s via HTTP/2 push. Lower latency (70ms vs. 200ms), higher throughput. Cost: $0.015 per consumer-shard-hour. Worth it for 2+ consumers.

4. Implement Error Handling and Retry

Lambda integration: On function error, Kinesis retries the batch automatically until success or retention end. Implement idempotency (same record processed multiple times).

Dead Letter Queue (DLQ): Failed batches to SQS after max retries. Bisect on Function Error: Kinesis halves the batch on error (isolates problematic records). On-Failure Destination to SNS for alerting.

5. Monitor Iterator Age

Iterator Age = time between record write and consumer read. Shows consumer lag. Ideal: <1 minute. Alarm at >5 minutes (consumer falling behind).

Causes: Too slow consumer processing, too few shards, too little Lambda concurrency. Solution: Shard scaling, increase Lambda reserved concurrency, optimize consumer code.

6. Use Compression and Aggregation

KPL Aggregation: Kinesis Producer Library combines multiple user records into one Kinesis record (up to 1 MB). Reduces API calls, lowers costs. KCL/Lambda de-aggregates automatically.

Compression: Firehose compresses automatically (Gzip, Snappy, Zip). Reduces S3 storage costs by 70-90%, accelerates Athena queries. Trade-off: CPU costs for compression/decompression.

7. Optimize Shard Count

Too few shards: Throttling (WriteProvisionedThroughputExceeded), Iterator Age increases. Too many shards: Unnecessary costs, more complex management.

Calculation: Write throughput / 1 MB/s = Minimum shards. Headroom 20-30% for traffic spikes. On-Demand mode for variable workloads (automatic scaling).

8. Set Retention Based on Use Case

24 hours (default): Sufficient for most real-time use cases. Free (included in shard price).

7 days: For replay on consumer failures, developer debugging. $0.023 per GB-month.

365 days: For event sourcing, compliance, re-processing on logic changes. Cost-intensive at high throughput, but cheaper than S3 archiving with replay mechanism.

Amazon Kinesis vs. Alternatives

When comparing streaming platforms across cloud providers, different strengths emerge:

Amazon Kinesis vs. Google Cloud Pub/Sub

Pub/Sub is a simpler messaging system with fewer stream processing features. Pub/Sub: At-least-once delivery, no ordering guarantee (except with ordering keys). Kinesis: Guaranteed ordering per partition key.

Kinesis advantages: Long-term retention (up to 365 days), replay capability, Enhanced Fan-Out, tighter AWS integration.

Pub/Sub advantages: Simpler model (no shards), cheaper at low throughput, global topics without region lock.

Amazon Kinesis vs. Azure Event Hubs

Event Hubs very similar to Kinesis Data Streams: Partitions (similar to shards), retention up to 7 days (90 with Premium), Capture to Blob Storage (similar to Firehose).

Kinesis advantages: On-Demand mode, up to 365 days retention, Enhanced Fan-Out, Kinesis Data Analytics (SQL).

Event Hubs advantages: Kafka protocol support (lift-and-shift from on-premises Kafka), cheaper capture function, better Azure integration.

Amazon Kinesis vs. Apache Kafka (Self-Managed)

Kafka offers more features (exactly-once semantics, compacted topics, Kafka Streams/Connect). But: High ops overhead (cluster management, broker scaling, ZooKeeper).

Choose Kinesis: For managed solution, fast time-to-market, AWS-native applications, team without Kafka expertise.

Choose Kafka (MSK or self-managed): For Kafka-specific features, multi-cloud (Kafka runs everywhere), migration of existing Kafka workloads, full control.

As multi-cloud experts, we provide vendor-neutral advice for the optimal solution for your requirements.

Amazon Kinesis Integration with innFactory

As an AWS Reseller, innFactory supports you with:

Architecture Design: We design scalable streaming architectures with Kinesis. Event-driven design, Lambda integration, analytics pipelines. Optimal service selection (Data Streams vs. Firehose vs. Analytics).

Migration: Secure migration of existing streaming solutions (Kafka, RabbitMQ, on-premises log aggregation) to Kinesis. Hybrid setups for gradual migration. Zero-downtime migrations.

Performance Optimization: Partition key optimization for even shard distribution. Enhanced Fan-Out for latency-sensitive consumers. KPL aggregation for cost reduction. Shard auto-scaling implementation.

Security & Compliance: GDPR-compliant Kinesis implementation in EU regions. Encryption at rest (KMS), encryption in transit (TLS). VPC endpoints for private connectivity. IAM policies for least privilege.

Cost Optimization: Analysis of your Kinesis usage. Provisioned vs. On-Demand trade-off. Compression and aggregation. Retention optimization. Typical savings: 30-50%.

24/7 Support: Monitoring of Kinesis metrics (Iterator Age, throughput, errors). Alerting on throttling or consumer lag. Incident response for stream failures. Proactive shard scaling recommendations.

Contact us for a non-binding consultation on Amazon Kinesis and real-time streaming architectures on AWS.

Available Tiers & Options

Kinesis Data Streams (Provisioned)

Strengths
  • Predictable costs
  • Control over shard count
  • Ideal for consistent workloads
Considerations
  • Manual shard management
  • Over-provisioning for variable loads

Typical Use Cases

Real-time analytics
Log processing
IoT data streaming
Clickstream analysis

Technical Specifications

Consumers Multiple parallel consumers
Firehose destinations S3, Redshift, OpenSearch, Splunk, HTTP endpoints
Max record size 1 MB
Ordering Per partition key guaranteed
Retention 24 hours (default), up to 365 days
Throughput ondemand 200 MB/s write, 400 MB/s read (auto-scales)
Throughput provisioned 1 MB/s write, 2 MB/s read per shard

Frequently Asked Questions

What is Amazon Kinesis?

Amazon Kinesis is a family of services for real-time data streaming. Kinesis Data Streams enables ingestion and processing of streaming data in real-time. Kinesis Data Firehose automatically delivers data to storage targets (S3, Redshift, OpenSearch). Kinesis Data Analytics runs SQL queries on streams. Kinesis Video Streams handles video ingestion.

How much does Amazon Kinesis cost?

Kinesis Data Streams Provisioned: $0.015 per shard-hour plus $0.014 per million PUT requests. On-Demand: $0.040 per GB ingested, $0.013 per GB retrieved. Kinesis Data Firehose: $0.029 per GB ingested. Kinesis Data Analytics: $0.11 per KPU-hour. Extended Retention (>24h): $0.023 per GB-month. Typical costs: $50-500/month.

When to use Data Streams vs. Firehose?

Data Streams for: Real-time processing (<200ms latency), custom consumer logic (Lambda, EC2, EKS), multiple consumers, replay-capable data (up to 365 days retention). Firehose for: Near-real-time (60s latency acceptable), direct-to-storage (S3, Redshift), no custom processing logic, simple batching and compression. Firehose is simpler, Data Streams is more flexible.

How does Kinesis sharding work?

Shards are parallelization units in Kinesis Data Streams. Each shard provides 1 MB/s write, 2 MB/s read throughput. Records are distributed to shards via partition key (hash-based). Same partition key = same shard (ordering guaranteed). Provisioned Mode: Manual shard management via SplitShard/MergeShards. On-Demand Mode: Automatic sharding.

What is Enhanced Fan-Out?

Enhanced Fan-Out gives each consumer dedicated 2 MB/s throughput per shard (instead of shared throughput). Standard: All consumers share 2 MB/s per shard. Enhanced Fan-Out: Consumer A and B each get 2 MB/s. Uses HTTP/2 push instead of polling. Cost: $0.015 per consumer-shard-hour plus $0.013 per GB. Ideal for >2 consumers or latency-sensitive workloads.

How do I integrate Kinesis with Lambda?

Lambda can use Kinesis Streams as an event source. Lambda polls the stream automatically, invoking functions with batches (up to 10,000 records). Batch size and window are configurable. On error: Retry until success or batch expires. Parallelization Factor enables multiple Lambda invocations per shard (up to 10x). Ideal for event-driven processing without server management.

AWS Cloud Expertise

innFactory is an AWS Reseller with certified cloud architects. We provide consulting, implementation, and managed services for AWS.

Ready to start with Amazon Kinesis - Real-time Data Streaming?

Our certified AWS experts help you with architecture, integration, and optimization.

Schedule Consultation