GithubHelp home page GithubHelp logo

rajeev-jha1988 / reinvent2015-practicaldynamodb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amazon-archives/reinvent2015-practicaldynamodb

0.0 2.0 0.0 0 B

License: Apache License 2.0

Java 100.00%

reinvent2015-practicaldynamodb's Introduction

Introduction

This project is used for demonstrating how Amazon DynamoDB could be used together with AWS Lambda to perform real-time and batch analysis of domain specific data. Real-time analysis is done using DynamDB streams as an event source of a Lambda function. Batch processing utilizes the parallel scan Action of DynamoDB to distribute work to Lambda. Although this is a Maven project, AWS Lambda functions cannot be deployed by Maven. It is expected to use Eclipse to deploy the AWS Lambda functions and run the sample code.

Prerequisite

STEP 1 - Prepare demo resources

  • Setup Credentials
  • Create DynamoDB tables
    • In datasetinit package, run the CreateFunctionTrackerTable, CreateHighScoresByDateTable, CreatePlayerStatsTable and CreateScoresTable classes.
  • Create a DynamoDB Streams sourced Lambda function
    • Upload the streamhandling.ScoresTableTrigger Lambda function to the us-west-2 region(use any function name).
      • Right click handleRequest method -> AWS Lambda -> Upload Function to AWS Lambda...
    • In the console, add a new event source for this Lambda function
      • DynamoDB table: Scores
      • Batch size: 100 (default)
      • Starting position: trim horizon
  • Create the Batch processing Lambda function
    • Upload the parallelscan.SegmentScannerFunctionHandler Lambda function to the us-west-2 region.
      • Function name: TableSegmentScannerFunction
      • Timeout: 300s (max)

STEP 2 - Start generating scores data

  • Right click handleRequest method -> AWS Lambda -> Run Function on AWS Lambda...
    • An insertion event will be simulated using dynamodb-event.insert.json file to insert a record
    • You will notice a new record is inserted to PlayerStats table from AWS console
  • Run datasetinit.GenerateScores to simulate inserting records to the Scores table.
  • From the console, you will notice the PlayerStats table updating records due to the streaming Lambda function setup earlier.

STEP 3 - Invoke scanner function to transform existing data

  • Run the parallelscan.FunctionInvoker class.
  • After it finishes, check HighScoresByDate table.

For more information, refer to reInvent 2015 demo video on Youtube.

reinvent2015-practicaldynamodb's People

Watchers

James Cloos avatar R2J 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.