DEV Community

Cover image for CDK AWS Aurora PostgreSQL Limitless
2 1 1 1 1

CDK AWS Aurora PostgreSQL Limitless

Abstract

  • The Amazon Aurora PostgreSQL Limitless Database is now generally available, offering an advanced solution to scale your Aurora cluster seamlessly. This technology enables millions of write transactions per second and supports petabytes of data, all while maintaining the simplicity of operating a single database instance.
  • This post outlines a structured approach to creating an Amazon Aurora PostgreSQL Limitless Database using the AWS Cloud Development Kit (CDK) in TypeScript for demontration of Amazon Aurora PostgreSQL Limitless Database

Table Of Contents


πŸš€ Deploying Aurora PostgreSQL Limitless Database Using AWS CDK

  • The structure includes VPC, Aurora PostgreSQL Limitless Database with one shard group, secret manager for storing RDS credential, EC2 as bastion-host for access database in private network

alt text

  src
  β”œβ”€β”€ bin
  β”‚   └── main.ts
  └── lib
      β”œβ”€β”€ cluster.ts
      └── shared
          β”œβ”€β”€ constants.ts
          β”œβ”€β”€ environment.ts
          β”œβ”€β”€ index.ts
          └── tagging.ts
Enter fullscreen mode Exit fullscreen mode
  • Adjust CDK_DEFAULT_REGION and CDK_DEFAULT_ACCOUNT in src/lib/shared/constants to yours

  • Adjust the max

  serverlessV2MaxCapacity: 64, // Adjust this for your test.
  serverlessV2MinCapacity: 16, // Minimum allow is 16
Enter fullscreen mode Exit fullscreen mode
  • Deploy
  βœ— cdk ls
  AuroraPostgresLimitlessClusterStack

  βœ— cdk deploy AuroraPostgresLimitlessClusterStack
Enter fullscreen mode Exit fullscreen mode

πŸš€ Test

  • Cluster created

alt text

  • Go to sample_sql
  cd sample_sql
Enter fullscreen mode Exit fullscreen mode
  • Create E-Commerce sample schema's standard tables
  \i create_standard_tables_ec_sample_schema.sql
Enter fullscreen mode Exit fullscreen mode
  • Convert E-Commerce sample schema's standard tables to limitless tables
  \i convert_standard_tables_to_limitless_ec_sample_schema.sql
Enter fullscreen mode Exit fullscreen mode
  • Load data into the orders and orderdetails tables using pgbench
  pgbench  -n --client=500 --jobs=100 --progress=60 --transactions=2000  -f insert_orders_orderdetails_ec_sample_schema.sql
Enter fullscreen mode Exit fullscreen mode

alt text

πŸš€ Check workload and scaling

  • Performance insight

alt text

  • Cloudwatch metrics

alt text

  • Query limitless table

alt text

  • Query database tables

alt text

πŸš€ Cleanup

  • Destroy resources to avoid cost
  cdk destroy AuroraPostgresLimitlessClusterStack
Enter fullscreen mode Exit fullscreen mode

πŸš€ Conclusion

  • Give Aurora PostgreSQL Limitless Database a try by using AWS CDK to provision cluster faster and in secure way
  • Remember to adjust the query size and time of running to avoid huge cost

References:

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (2)

Collapse
 
m0ltzart profile image
Roman β€’

That’s a bit like β€˜the rest of the owl’ meme. Do you have the code for CDK? I didn’t even think there was CloudFormation support yet.

Collapse
 
vumdao profile image
πŸš€ Vu Dao πŸš€ β€’

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post