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
Open 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
-
Source code:
src βββ bin β βββ main.ts βββ lib βββ cluster.ts βββ shared βββ constants.ts βββ environment.ts βββ index.ts βββ tagging.ts
-
Adjust
CDK_DEFAULT_REGION
andCDK_DEFAULT_ACCOUNT
insrc/lib/shared/constants
to yours -
Adjust the max
serverlessV2MaxCapacity: 64, // Adjust this for your test. serverlessV2MinCapacity: 16, // Minimum allow is 16
-
Deploy
β cdk ls AuroraPostgresLimitlessClusterStack β cdk deploy AuroraPostgresLimitlessClusterStack
π Test
-
Cluster created
-
Go to
sample_sql
cd sample_sql
-
Create E-Commerce sample schemaβs standard tables
\i create_standard_tables_ec_sample_schema.sql
-
Convert E-Commerce sample schemaβs standard tables to limitless tables
\i convert_standard_tables_to_limitless_ec_sample_schema.sql
-
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
π Check workload and scaling
-
Performance insight
-
Cloudwatch metrics
-
Query limitless table
-
Query database tables
π Cleanup
- Destroy resources to avoid cost
cdk destroy AuroraPostgresLimitlessClusterStack
π 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: