Back to case studies

Unleashing the Power of AWS Kinesis: How to Achieve Cost-Effective Data Streams Integration and Processing 

Introduction to AWS Kinesis 

In the current era of digital data, businesses face the challenge of efficiently managing and leveraging the vast amounts of information generated daily. To solve these problems companies developed a lot of different solutions. One of the solutions is Amazon Kinesis which cost-effectively processes and analyzes streaming data at any scale as a fully managed service. With AWS Kinesis, the developer can ingest real-time data, such as video, audio, application logs, website clickstreams, and IoT telemetry data, for machine learning (ML), analytics, and other applications. By leveraging Kinesis, organizations unlock the power of real-time insights and drive informed decision-making.  

Understanding data streams integration and processing 

To understand better the purpose of AWS Kinesis, first we need to know what a data stream is. A data stream is a continuous transfer of data at a high rate of speed from multiple sources. Data streams are used for various purposes, such as fraud detection, artificial intelligence, business intelligence, and targeting. AWS Kinesis is a service that enables you to collect, process, and analyze data streams in real time and send it to the proper instance on AWS.  

A Kinesis data stream is a set of shards (a uniquely identified sequence of data records in a stream). Each shard has a sequence of data records. Each data record has a sequence number that is assigned by Kinesis Data Streams. A consumer can process the data stream. AWS supports many different technologies for Kinesis producers and consumers e.g. Node.js, Python or .NET.  

Benefits of using AWS Kinesis

Flexibility – Due to its serverless solution, the tools available in the AWS Kinesis service are very flexible. You do not have to worry about increasing the computing capacity of the servers, because the entire data stream will be saved and transferred only when the consumer is ready to process the next part of the data. 

Reliability – Kinesis can bring reliability to our overall solution. Because it gives us the ability to assign a time point to each record, even despite a failed deployment, we can go back to a certain point in time and process the data once again. This is a remarkable advantage over, for example SQS, which irretrievably deletes data after reading it. 

AWS Kinesis pricing and cost effectiveness 

Kinesis pricing 

AWS Kinesis pricing depends on several factors, such as the region in which you run your streams, the amount of data you stream and process, and the number of resources you use. For example, for Kinesis Data Streams, you pay for each hour that a stream is active, regardless of whether you upload data or not. In addition, you pay for each gigabyte of data transferred. For Kinesis Data Firehose, you pay for each gigabyte of data transferred, but there is no charge for the hours the stream is active. 

Cost effectiveness 

AWS Kinesis can be very cost-effective if you need to process enormous amounts of data in real time. With its flexible pricing model, you only pay for what you use, meaning you do not have to worry about paying for unused resources. 

Power of AWS Kinesis

To demonstrate the capabilities of AWS Kinesis a simple example of capturing, editing, analyzing, and storing telemetry data from a website using as many of the tool’s AWS offers as possible was used. 

  • Website – It also can be backend; the key is to secure connection between client and API Gateway (it may be API KEY for example) and send data to process. 
  • Amazon API Gateway – Serverless solution in which you gain full scalability and elasticity in development. Can secure your connection, validate incoming requests, and send it further. 
  • Amazon Kinesis Data Streams – Collect data from API Gateway, store it with timestamp, so in case something went wrong you can roll back to unprocessed data. Also, in this case if request occur limit of Lambda Concurrent executions, data will be stored in Data Streams and wait for consumer to process it. 
    Kinesis Data Streams can store data in streams for a configurable retention period. By default, this period is 24 hours but it can be increased up to 365. 
  • AWS Lambda – Take data from kinesis and add information to it about website users from Amazon Cognito. 
  • Amazon Kinesis Data Analytics – Designed for analytics team to get valuable information. For example, if there is some request that depends on each other this tool will wait unit it gets all request together for further analysis. 
  • Amazon Kinesis Data Firehose – Aggregates the data into chunks of 10 MB each, or after collecting them in the space of 5 minutes and sending them to the clipboard, in this case S3. (Sends data only to one destination) 
  • Amazon S3 – Stores data to allow further analysis of collected data. 

This is just an example. It all depends on the business need and our capabilities. Undoubtedly, AWS Kinesis is a powerful tool that can be very useful. 

The flexibility of AWS Kinesis  

Let’s assume that we want to process requests from a third-party service. For this solution, we need to pull things of interest from the data so that we can integrate it with the service we already have. Below is a description of an example solution that is resistant to temporary large spikes with POST requests and gives the ability to reprocess the data if the need arises. 

  • Third part Service – Sends data for processing. Unfortunately, there are things in there that can get in the way of further work with the data. 
  • Amazon API Gateway – Authorizes service verifies that data contains key fields. 
  • AWS Lambda – It sends a request to AWS glue and receives the Avro schema. After receiving the schema the data from the API gateway it is mapped and then as an encoded message send by request to Kinesis Data Analytics. 
  • AWS Glue – The topic was explored more in one of our last case study. To validate the request a Avro file is used it shows what types should a given object have. 
  • Amazon Kinesis Data Analytics – In this case it works as a queue, but with a very important possibility for this service which is to return to previous requests. 
  • API – Processes data in different ways, with different data 

As shown, AWS Kinesis allows us to use individual components, which can meet our needs and optimize various types of costs.

AWS Kinesis alternatives for data streams integration and processing 

AWS SNS (Simple Notification Service): SNS is a fully managed publish-subscribe messaging service. It is best suited for real-time messaging and notifications. SNS enables you to send messages reliably between parts of your infrastructure. However, the data of the notification is not stored, and you cannot roll back to a previous version. 

AWS SQS (Simple Queue Service): SQS is a fully managed message queuing service. It is best suited for asynchronous messaging and decoupling systems. SQS allows developers to publish messages to a Queue, that the consuming application can process either immediately or later. Like SNS the data after consuming is deleted and restored. 

AWS EventBridge – is a serverless event bus service. It is best suited for real-time event-driven architecture and connecting different services. EventBridge simplifies routing events between AWS services, software as a service (SaaS) provider, and your own applications. It works as a filter that can send data to different consumers but does not store it for future use. 

Apache Kafka – is an open-source distributed event streaming platform. It is more highly configurable compared to Kinesis. With Kafka, it is possible to write data to a single server. Kafka is also known for its decoupled nature, making it useful for node failures. 

Conclusion and key takeaways 

In conclusion, AWS Kinesis is a powerful and scalable platform for streaming data ingestion and processing. It enables users to create real-time applications that can manage various use cases, such as log analysis, metrics and reporting, data analytics, and complex stream processing. By using Kinesis Data Streams, users can benefit from the durability, elasticity, and fault-tolerance of the service, as well as the integration with other AWS services and tools Kinesis Data Streams is part of the Kinesis streaming data platform, which also includes Firehose. With Kinesis, users can leverage the potential of streaming data to gain insights and drive actions in real time. 

Get in touch and let’s talk.

daniel ceo
Write to us on:

    Your message was successfully sent.

    Thank you for contacting us. We will get back to you as soon as possible.