Giter Club home page Giter Club logo

serverless-realtime-analytics's Introduction

Serverless Realtime Analytics

This application demonstrates how to create a realtime analytics serverless application using Amazon Kinesis Data Streams, Amazon Kinesis Firehose, Amazon DynamoDB, AWS Lambda, Amazon API Gateway, Amazon Cognito, Amazon Simple Storage Service, Amazon Cloudfront, AWS Amplify and AWS Cloud Development Kit.

  • Amazon Kinesis Data Streams - We will use this service as it provides a serverless mechanism for realtime data ingestion, also, provides the flexibility to add a Lambda as a trigger and attach a Kinesis Firehose for data storage to S3.
  • Amazon Kinesis Firehose - We will use this service to store the data ingested by the Data Stream for later analytics.
  • Amazon DynamoDB - Using DynamoDB we will have a Serverless and low latency database.
  • AWS Lambda - Here we will deploy the update and query lambda functions.
  • Amazon Simple Storage Service - We will use a bucket to store all the data ingested for future analysis.
  • Amazon Cognito - We will create a user and identity pool in Cognito to secure our analytics application.
  • Amazon API Gateway - API Gateway will be used as the Facade for our query lambda function and will secure the function using a Cognito Authenticator.
  • Amazon Cloudfront - We will create a distribution for our static content.
  • AWS Cloud Development Kit - Using AWS CDK we will create all the infrastructure needed for the project.
  • AWS Amplify - Using Amplify in our web application we will integrate it with Cognito and API Gateway.

Pre requisites

To deploy this demo you need:

NOTES:

Architecture

This is an overview of all the components in the application architecture.

Architecture

Deployment

This application consists of two CDK stacks:

  • RealTimeAnalyticsPocStack - This stack contains the most of the infrastructure and application. To deploy use the following commands:
    • $ npm run build
    • $ cdk deploy RealTimeAnalyticsPocStack

Sample output Output

  • RealTimeAnalyticsWebStack - This stack contains only the static web application, you will need to update the web/dashboard/src/main.js file with the outputs of the previous stack. Once updated:
    • $ cdk deploy RealTimeAnalyticsWebStack

Testing

To test the application we can use the project Kinesis Data Generator. Follow the instructions in the project page to deploy the tool.

You can use the following template for testing: session={{date.now('YYYYMMDD')}}|sequence={{date.now('x')}}|reception={{date.now('x')}}|instrument={{random.number(9)}}|l={{random.number(20)}}|price_0={{random.number({"min":10000, "max":30000})}}|price_1={{random.number({"min":10000, "max":30000})}}|price_2={{random.number({"min":10000, "max":30000})}}|price_3={{random.number({"min":10000, "max":30000})}}|price_4={{random.number({"min":10000, "max":30000})}}|price_5={{random.number({"min":10000, "max":30000})}}|price_6={{random.number({"min":10000, "max":30000})}}|price_7={{random.number({"min":10000, "max":30000})}}|price_8={{random.number({"min":10000, "max":30000})}}|

Clean Up

To clean up your account delete all files in the bucket created and run delete the CloudFormation stacks:

  • $ cdk destroy RealTimeAnalyticsWebStack
  • $ cdk destroy RealTimeAnalyticsPocStack

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

serverless-realtime-analytics's People

Contributors

amazon-auto avatar ferroh-aws avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.