Giter Club home page Giter Club logo

aws-etl-kinesis-data-streams-firehose-itl-java's Introduction

AWS Serverless Ingest Transform Load (ITL) Pattern

Kinesis Data Stream - Kinesis Firehose - Lambda - S3

This is a Java implementation of the ITL Pattern using AWS serverless services.

Reference: https://aws.amazon.com/kinesis/data-firehose/

In this example DynamoDB Stream will send events to Kinesis Data Stream, which will forward them to the Kinesis Firehose. A Lambda function will transform these messages, return the processed event and finally Kinesis Firehose will load them into an S3 bucket.

This is a fully managed and scalable pattern, you only need to maintain the Lambda function code.

The SAM template contains all the information to deploy AWS resources and also the permission required by these service to communicate.

You will be able to create and delete the CloudFormation stack using the AWS CLI.

This is fully functional example implemented in Java 11.

Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the AWS Pricing page for details. You are responsible for any AWS costs incurred.

Language:

This is a Maven project which uses Java 11 and AWS SDK

Framework

The framework used to deploy the infrastructure is SAM(AWS Serverless Application Model)

Services used

The AWS services used in this pattern are

DynamoDB - DynamoDB Stream - Kinesis Data Stream - Kinesis Data Firehose - Lambda - S3

Topology

topology

Deployment commands

mvn clean package

# create an S3 bucket where the source code will be stored
# the bucket name must be unique globally so feel free to change the bucket name
aws s3 mb s3://tyyiwid97293uodiuidausd

# copy the source code located in the target folder:
aws s3 cp target/sourceCode.zip s3://tyyiwid97293uodiuidausd

# SAM will deploy the CloudFormation stack described in the template.yml file:
sam deploy --s3-bucket tyyiwid97293uodiuidausd --stack-name itl-pattern --capabilities CAPABILITY_IAM

Testing

To test the endpoint first send data using the following command. Be sure to update the endpoint with endpoint of your stack.

aws dynamodb put-item --table-name SourceDDBTable --item '{"SensorID": {"S": "SEN200"},"Temp": {"S": "26"}}' --return-consumed-capacity TOTAL
aws dynamodb put-item --table-name SourceDDBTable --item '{"SensorID": {"S": "SEN300"},"Temp": {"S": "29"}}' --return-consumed-capacity TOTAL
aws dynamodb put-item --table-name SourceDDBTable --item '{"SensorID": {"S": "SEN400"},"Temp": {"S": "31"}}' --return-consumed-capacity TOTAL

aws s3 ls s3://deliverybucketibercodekdfow33ew2 --recursive --human-readable --summarize

aws s3 cp s3://deliverybucketibercodekdfow33ew2/COPY_FROM_PREVIOUS_OUTPUT.gz data.gz

gunzip data.gz

cat data

Cleanup

Run the given command to delete the resources that were created. It might take some time for the CloudFormation stack to get deleted.

aws s3 rm s3://deliverybucketibercodekdfow33ew2 --recursive

aws cloudformation delete-stack --stack-name itl-pattern

aws s3 rm s3://tyyiwid97293uodiuidausd --recursive

aws s3 rb s3://tyyiwid97293uodiuidausd

Requirements

Author bio

Razvan Minciuna Software Architect https://www.linkedin.com/in/razvanminciuna/

aws-etl-kinesis-data-streams-firehose-itl-java's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.