AWS Builder Center

Title: Building a Real-Time Data Pipeline with Amazon Kinesis

Learn how Amazon Kinesis and AWS Lambda process streaming data in real time through a practical AWS hands-on project.

IT Student | Full-Stack Developer | AI/ML & Cloud Enthusiast
Modern applications generate large amounts of data every second, including website activity, application events, sensor readings, and transaction records.
Amazon Kinesis Data Streams helps developers collect and process these continuous data streams without building and maintaining their own messaging infrastructure.

Five important AWS concepts

  1. Kinesis Data Streams: Collect continuous streams of application data.
  1. Data Producers: Send events such as clicks, transactions, and sensor readings.
  1. Data Consumers: Read and process incoming records.
  1. AWS Lambda: Automatically process stream records without managing servers.
  1. CloudWatch: Monitor incoming records, processing activity, and errors.

Hands-on AWS Example: Build a Website Activity Monitoring Pipeline

Objective: Send website activity events to Kinesis and process them automatically using Lambda.
Step 1: Create a Kinesis stream
  • Open the AWS Management Console.
  • Navigate to Amazon Kinesis.
  • Create a Data Stream named  WebsiteActivityStream .
  • Use an appropriate shard configuration for your test workload.
Step 2: Create a Lambda function
Choose Python as the runtime and use this code:
import json
import base64

def lambda_handler(event, context):
for record in event["Records"]:
data = base64.b64decode(
record["kinesis"]["data"]
).decode("utf-8")

activity = json.loads(data)
print("User:", activity["user"])
print("Action:", activity["action"])

return {"status": "processed"}
Step 3: Configure the Lambda trigger
  • Open your Lambda function.
  • Add an Amazon Kinesis trigger.
  • Select  WebsiteActivityStream .
  • Configure the starting position as  LATEST .
  • Enable the trigger.
Step 4: Send a sample event
Use the AWS CLI to publish a record:
aws kinesis put-record \
--stream-name WebsiteActivityStream \
--partition-key user101 \
--data '{"user":"Abhi","action":"PageVisited"}'
Step 5: Verify processing
Open the Lambda Monitor section and check CloudWatch logs.
Expected output:
User: Abhi
Action: PageVisited

What You Learn

By completing this exercise, you gain practical experience with real-time data ingestion, streaming architecture, event processing, Lambda integration, and cloud monitoring.
Important: Configure the required IAM permissions for Kinesis and Lambda. Ensure your Lambda function has permission to read from the stream. Review AWS pricing and delete test resources after completing the exercise.
Real-time data processing helps businesses turn continuous streams of events into useful information and faster decisions.
What would you build with this architecture: a live website analytics dashboard, IoT monitoring system, or transaction tracking platform?
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article