Git Product home page Git Product logo

awsdataarchitect / dynamdb-l1-construct-with-autoscaling Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 6 KB

Example open-source repo for Scaling DynamoDB Capacity using AWS-CDK L1 Construct Library that does not natively support auto-scaling in CfnTable construct

Home Page: https://vivek-aws.medium.com/scaling-dynamodb-capacity-using-aws-cdk-l1-construct-library-that-does-not-natively-support-cf3ace6d041d

JavaScript 24.78% TypeScript 75.22%
aws cdk cdk-construct-library cloudformation dynamodb

dynamdb-l1-construct-with-autoscaling's Introduction

Example open-source repo for Scaling DynamoDB Capacity using AWS-CDK L1 Construct Library that does not natively support auto-scaling in CfnTable construct

If you are using only L1 constructs in your application, then DynamoDB tables Level 1 construct (CfnTable), does not natively support auto-scaling for local table, so how does one implement the Autoscaling for provisioned read/writes ? 

Note: CfnTable does however support Autoscaling for the Global Tables in CloudFormation templates

To understand the root cause, this is because the Level 1 construct CfnTable maps directly to the CloudFormation resource AWS::DynamoDB::Table and you can only define the resource's properties when using the Level 1 construct.

DynamoDB uses Application Autoscaling to automatically scale the table's capacity .  Thus, you would need to use the CfnScalableTarget & CfnScalingPolicy constructs of application autoscaling resource to enable autoscaling on DynamoDB.

This sample repo shows implementation using AWS CDK Application Auto Scaling L1 construct library for a DynamoDb resource.

For more details, refer to the Blog Post.

The cdk.json file tells the CDK Toolkit how to execute your app.

Useful commands

  • npm run build compile typescript to js
  • npm run watch watch for changes and compile
  • npm run test perform the jest unit tests
  • npx cdk deploy deploy this stack to your default AWS account/region
  • npx cdk diff compare deployed stack with current state
  • npx cdk synth emits the synthesized CloudFormation template

dynamdb-l1-construct-with-autoscaling's People

Contributors

awsdataarchitect avatar

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.