Amazon Kinesis Data Streams
Cloud service · AWS · Updated

Amazon Kinesis Data Streams

In short

Amazon Kinesis Data Streams is a scalable and durable real-time data streaming service that enables developers to continuously capture gigabytes of data per second from hundreds of thousands of sources such as website clickstreams, database event streams, financial transactions, social media feeds, IT logs, and location-tracking events.

Cloud Services Hub →

8 key features of Amazon Kinesis Data Streams

Amazon Kinesis Data Streams offers real-time processing, high throughput with low latency, easy scalability, seamless integration with the AWS ecosystem, and outstanding durability and availability for streaming data.

01
Real-Time Processing

Amazon Kinesis Data Streams enables the continuous collection and processing of data records in real time, allowing you to respond promptly to new information.

02
High Throughput, Low Latency

The service is designed to handle high volume and high velocity data streams, offering low latency processing for a seamless data streaming experience.

03
Scalability

You can easily scale your Kinesis Data Streams to match the volume and throughput of your data without managing infrastructure, ensuring that your data processing capabilities grow with your needs.

04
Integration with AWS Ecosystem

Kinesis Data Streams is fully integrated with a wide array of AWS services, making it simple to process and analyze streaming data with services like AWS Lambda, Amazon S3, and Amazon Redshift.

05
Durability and Availability

Data records are stored across multiple Availability Zones in a region, offering high durability and availability, ensuring that your streaming data is available when you need it.

06
Kinesis Producer Library

The Kinesis Producer Library (KPL) provides a configurable library for writing data to a Kinesis data stream.

07
Kinesis Client Library

The Kinesis Client Library (KCL) provides a configurable library for consuming and processing records from a data stream.

08
Complex Stream Processing

Kinesis Data Streams applications and streams can form directed acyclic graphs, with multiple applications feeding another stream for downstream processing.

Where Amazon Kinesis Data Streams is used

Amazon Kinesis Data Streams is versatile in handling real-time data processing and analysis, serving various scenarios including real-time analytics, log and event data collection, IoT device streaming, time-series data analysis, and live video and audio streaming.

  1. 01
    Real-Time Analytics

    Amazon Kinesis Data Streams collects, processes, and analyzes real-time data such as video, audio, application logs, website clickstreams, and IoT telemetry data. With it, businesses can gain valuable insights instantaneously, enabling rapid decision-making. This is particularly useful in sectors like finance for fraud detection, e-commerce for personalized recommendations, or online gaming for real-time player analytics.

  2. 02
    Log and Event Data Collection

    This use case focuses on gathering log and event data from various sources like applications, servers, and sensors. By streaming this data through Kinesis Data Streams, organizations can aggregate, monitor, and analyze logs in real-time. This aids in troubleshooting, monitoring application health, and gaining operational insights, leading to improved service reliability and performance.

  3. 03
    IoT Device Data Streaming

    Kinesis Data Streams serves as a backbone for IoT applications, streaming large volumes of data from connected devices to the cloud. This enables real-time processing of IoT data for scenarios such as predictive maintenance, real-time asset tracking, and smart home automation. By leveraging this, organizations can respond to IoT device signals promptly and make data-driven decisions.

  4. 04
    Time-series Data Analysis

    Applications that produce time-series data, like metrics, stock trading volumes, or weather data, can use Kinesis Data Streams for real-time ingestion and processing. This facilitates immediate analysis and visualizations, helping in forecasting, trend analysis, and making proactive business decisions based on temporal data patterns.

How Amazon Kinesis Data Streams is priced

Amazon Kinesis Data Streams pricing is based on shard hour consumption, Put Payload Units ingested, and optional features like extended data retention and enhanced fan-out.

Shard Hour Pricing

In provisioned mode, you specify the number of shards and are charged for each shard at an hourly rate.

Put Payload Unit Pricing

Costs are also associated with the amount of data ingested into your Kinesis Data Streams. Each Put Payload Unit (PPU) represents a 25KB data payload, and pricing is based on the number of PPUs ingested.

Extended Data Retention and Enhanced Fan-out Pricing

Additional charges apply for extended data retention beyond the default period; enhanced fan-out does not incur an additional charge in On-demand Advantage.

On-demand Standard Pricing

On-demand Standard charges for data ingested and retrieved, plus an hourly charge for each stream.

On-demand Advantage Pricing

On-demand Advantage charges for data ingested and retrieved, subject to account-level minimum usage commitments, rather than a fixed hourly charge for each stream.

S3 Delivery Pricing

S3 delivery is billed per GB successfully delivered, with rates varying by capacity mode and no setup fees, minimum commitments, or upfront costs.

Streaming Tables Delivery Pricing

Streaming tables delivery is billed per GB of uncompressed data successfully delivered, with rates varying by capacity mode and no setup fees, minimum commitments, or upfront costs.

Long-Term Data Retrieval Pricing

In provisioned mode, retrieving data stored beyond seven days through GetRecords incurs a per-GB charge; this long-term retrieval charge does not apply when using SubscribeToShard enhanced fan-out consumers.

Data Transfer Pricing

Same-Region transfers between producers, Kinesis Data Streams, and consuming applications have no data transfer charge. Cross-Region writes incur standard AWS data transfer charges. Cross-Region reads incur data transfer charges in On-demand Standard and On-demand Advantage, but not in provisioned mode.

Services Amazon Kinesis Data Streams works with

AWS LambdaAWS Lambda

AWS Lambda allows you to process and analyze streaming data in real-time by triggering Lambda functions to execute custom code in response to new data records.

Amazon Data FirehoseAmazon Data Firehose

Amazon Data Firehose is used to transform and load streaming data into Amazon S3, Amazon Redshift, Amazon OpenSearch Service, and Splunk.

AWS GlueAWS Glue

AWS Glue can be used to discover and prepare data stored in Amazon Kinesis Data Streams for analytics and machine learning.

Amazon CloudWatchAmazon CloudWatch

Amazon CloudWatch allows you to monitor Amazon Kinesis Data Streams, track metrics, and set alarms to manage the health and performance of your streaming data applications.

Amazon API GatewayAmazon API Gateway

Kinesis Data Streams can receive records directly through API Gateway AWS service integrations. An API can map incoming HTTP requests to PutRecord or PutRecords operations without a Lambda function.

Amazon AuroraAmazon Aurora

Kinesis Data Streams carries database activity events published by Aurora Database Activity Streams. Security and auditing applications can consume these events to monitor database activity.

Amazon CloudFrontAmazon CloudFront

Kinesis Data Streams receives CloudFront real-time access logs through a configurable real-time log configuration. Consumers can analyze request traffic, cache performance, and errors as the logs arrive.

Amazon CognitoAmazon Cognito

Kinesis Data Streams can receive dataset-change records from Amazon Cognito Sync through its Cognito Streams feature. Consumers can process changes to synchronized application data.

Amazon ConnectAmazon Connect

Kinesis Data Streams can receive Amazon Connect contact records and agent events for real-time processing. Streams can also supply customer data to Connect Customer Profiles through an EventBridge Pipes integration.

Amazon DynamoDBAmazon DynamoDB

Kinesis Data Streams can capture item-level changes from DynamoDB tables through Kinesis streaming destinations. Separately, Kinesis Client Library consumers use DynamoDB tables to coordinate shard leases and store processing checkpoints.

What is Amazon Kinesis Data Streams

3 min read

Amazon Kinesis Data Streams is a scalable and durable real-time data streaming service, meticulously designed by Amazon Web Services (AWS) to enable developers and businesses to continuously capture, process, and store gigabytes of data per second. This powerhouse of a service caters to a wide array of use cases, including real-time analytics, machine learning model inference, log and event data ingestion, data feed monitoring, and much more, proving itself as an indispensable tool for data-driven decision-making and operational efficiency. 

At its core, Amazon Kinesis Data Streams is built to accommodate the streaming of enormous volumes of data with very low latencies, allowing for the processing of data in real time. This capability is particularly crucial in today's fast-paced digital landscape where businesses need to rapidly analyze and respond to information as it arrives. Unlike traditional batch data processing, which can involve delays as data accumulates before it is processed, Kinesis Data Streams enables immediate data processing, thereby empowering organizations to swiftly react to new information. 

Amazon Kinesis Data Streams provides a robust and flexible platform where data streams are divided into shards. Each shard represents a sequence of data records in the stream and provides a fixed unit of capacity. This design facilitates the parallel processing of streams, enhancing throughput and reducing latency. In provisioned mode, you can increase or decrease the shard count as needed and pay for the number of shards at an hourly rate. 

Kinesis Data Streams also offers On-demand Standard and On-demand Advantage modes, which manage capacity automatically. On-demand Advantage additionally lets you proactively configure warm throughput to handle expected traffic increases.

In both on-demand and provisioned modes, each shard supports writes of up to 1 MB/s and 1,000 records per second, and reads of up to 2 MB/s.

One of the most compelling advantages of Amazon Kinesis Data Streams is its seamless integration with a wide variety of AWS services. For instance, it can be connected with Amazon S3 for durable data storage, Amazon Redshift for data warehousing, Amazon OpenSearch Service for search and analytics, and AWS Lambda for serverless data processing. This integration capability simplifies architecture complexity and enables developers to build comprehensive real-time analytics solutions without the need to manage multiple disparate systems. 

Strict endpoint allowlists must include the account-level control-plane endpoints *.control-kinesis.<Region>.amazonaws.com and *.control-kinesis.<Region>.api.aws, and data-plane endpoints *.data-kinesis.<Region>.amazonaws.com and *.data-kinesis.<Region>.api.aws. The .api.aws endpoints support dual-stack connectivity, including IPv6.

Another key feature of Kinesis Data Streams is its built-in data redundancy and availability. Data in a Kinesis stream is automatically replicated to three different Availability Zones in an AWS Region, providing high durability and reliability. This multi-AZ replication ensures that your data stream is resilient to infrastructure failures, making it a trusted solution for mission-critical applications that require constant uptime and data integrity.

In conclusion, Amazon Kinesis Data Streams is a powerful, fully managed service that unlocks the potential of real-time data streaming for businesses and developers alike. By providing an easy-to-use yet highly scalable platform for the continuous capture, processing, and storage of large volumes of data, Kinesis Data Streams enables organizations to drive innovation, enhance operational efficiencies, and build real-time analytics applications that can swiftly adapt to the ever-evolving business landscape.

Concepts related to Amazon Kinesis Data Streams

Amazon Kinesis Data Streams exam questions

Real practice exam questions on Amazon Kinesis Data Streams, with the correct answer and its explanation. Answer them with every option in the exam simulator.

MLA-C02

A company uses an Amazon Kinesis Client Library (KCL) application on Amazon EC2 instances to validate events from Amazon Kinesis Data Streams and write training examples to a persistent data store. Each event has a globally unique event_id, and validation produces the same result whenever an event is replayed. The destination supports atomic upserts keyed by event_id, but it cannot participate in a transaction with KCL progress updates.

An instance can fail at any point, including immediately after a destination write succeeds. Replacement instances must resume near the last successfully processed records without omitting events or leaving multiple training rows for the same event. The stream retains all records needed for recovery.

Which implementation meets these requirements?

Show answerCORRECT ANSWER

Write training rows by using atomic upserts keyed by event_id. After all records through a sequence number in a shard have been durably written, checkpoint that sequence number through KCL.

KCL durably tracks progress for each shard so replacement workers can resume from recorded positions. Advancing progress only after successful writes prevents omitted output. A failure before the checkpoint can cause replay, but upserting by the stable event_id makes those repeated writes safe.

SAP-C03

A company operates applications in 80 AWS accounts in one AWS Region. Application logs are stored in Amazon CloudWatch Logs. The company needs to aggregate all application logs into a dedicated logging account. Two independent security analytics applications must process incoming logs within seconds. Either application must be able to restart processing from any point within the previous 72 hours without reading the source log groups or the archive. Logs must also be archived in Amazon S3 for seven years, with older objects transitioned to a low-cost archival storage class. Account administrators will deploy subscription configurations through an existing automation pipeline.

Which solution meets these requirements?

Show answerCORRECT ANSWER

Create a CloudWatch Logs logical destination in the logging account that targets a Kinesis Data Streams stream configured with 7-day retention. Give CloudWatch Logs an IAM role that can write to the stream, and configure the destination access policy and source administrators' permissions to allow cross-account subscriptions. Subscribe the application log groups to the destination. Run the analytics applications as independent stream consumers, and use Amazon Data Firehose with the stream as its source to archive records to S3 with lifecycle transitions and seven-year retention.

The logical destination and its access policy support cross-account CloudWatch Logs subscriptions. The destination's IAM role permits delivery into the stream. Kinesis Data Streams provides independent consumers and timestamp-based replay within its configured retention period; seven days exceeds the required 72 hours. A separate Firehose consumer can deliver the same data to S3, where lifecycle rules implement archival transitions and retention.

DEA-C01

A utility company uses an AWS Lambda event source mapping to process meter events from Amazon Kinesis Data Streams. Each event contains a unique event ID, and producers publish each event only once. The function updates a billing database. In a single database transaction, it checks for the event ID in a processed-events table, applies the billing update only if the ID is absent, and inserts the ID. Entries in the processed-events table are automatically deleted 24 hours after insertion.

The stream retains records for 7 days. Engineers sometimes replay retained records through the function after correcting unrelated processing issues. A replay can finish up to 7 days after an event was first processed. Immediate retries do not duplicate billing updates, but replays performed several days later sometimes do.

The company must prevent duplicate billing updates while preserving automatic retries and the full replay capability. Which change should a data engineer make?

Show answerCORRECT ANSWER

Retain processed-event entries for at least 8 days after insertion, and continue checking and updating the database within the existing transaction.

The durable record of a completed update must outlive every supported retry and replay. Eight days exceeds the maximum 7-day interval between initial processing and replay completion. Keeping the check, billing update, and event-ID insertion transactional also protects against concurrent processing and failures.

Practice Amazon Kinesis Data Streams in a full exam

Questions on Amazon Kinesis Data Streams in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

Learn Amazon Kinesis Data Streams in lessons

22 short lessons on Amazon Kinesis Data Streams in 6 certification courses.

and 16 more lessons

Open the lessons

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.