This demo helps handle write loads asynchronously and maintain existing databases with AWS SQS and Lambda. You'll be able to see and apply ways to handle intensive database write loads using the queue through this demo.
This demo is based on the ap-northeast-2
. (Seoul region)
- GitHub Username and GitHub Token
- AWS Access Key and Secret Key with permissions
- Node.js environment at your local machine
- CDK-CLI at your local machine
- Load testing tools such as JMeter
$ cp ./lib/.env-samples ./lib/.env
$ vim .env
- IAM Roles > Create Role
- Select "AWS service" at "Trusted entity type"
- Select "RDS" at "Use case" and select the item with "RDS" among the radio buttons.
- Click "Next", click "Next" again and click "Create Role"
# At root directory
$ npm i
$ cd ./lambda/rds-handler && npm i
$ cd .. && cd ..
$ npm run build
$ cdk bootstrap
$ cdk deploy
### Check
# If you don't have aws credential, you can fail deploying with cdk-cli
# you should set aws credential at your local machine.
# Please refer this link. (https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html)
Caution “Sleep 15m” is executed on the instance for a stable connection between the Demo Application and RDS Proxy.
Therefore, the demo application may not be booted properly; in this case, it is recommended to connect to the instance and run the Demo Applicaiton, or modify the "Launch Template" and refresh the instance after a certain period of time after the RDS Proxy opens.
Please wait about 5 minutes even if the creation with the cdk is complete 🥹
The example test schedule with JMeter is at statics/tester.
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.