Aurora Serverless v2 is an on-demand, auto-scaling configuration of Amazon Aurora. This is a very interesting offering by AWS and is for those who need a relational database and want to have a serverless approach at the same time. It scales database workloads to hundreds of thousands of transactions in a fraction of a second. This provides just the right amount of database resources for your application needs and it is currently available in preview for PostgreSQL or MySQL. At Xerris, we help our clients achieve their digital transformation goals.

Amazon Aurora Serverless v2

This article will present some of the basic features and do an introductory tutorial on creating and using an Amazon Aurora Serverless v2 database.

Key points:

  • Save up to 90% of your database cost compared to provisioning capacity for peak load
  • Scale to hundreds of thousands of transactions in a fraction of a second
  • Scale capacity up and down in fine-grained increments for just the right amount the application requires
  • Multi-AZ support, Global Database, Read Replicas, Backtrack, and Parallel Query
  1. Creating an Aurora Serverless database

Hopefully you have access to Aurora Serverless V2 given that it is currently in preview mode.

Log into your AWS console, go to the RDS service and press “Create database

The following will be the configuration for this demonstration

Database creation method: Standard create

Engine options: Amazon Aurora

Edition: PostgreSQL Compatibility

Capacity type: Serverless

Version: Aurora PostgreSQL (compatible with PostgrSQL 10.12)

DB cluster identifier: aserverlessv2cluster

Master username: v2master

Password: somepassword2001

Minimum Aurora capacity Unit 2(4GB RAM)

Maximum Aurora capacity Unit: 32 (64 GB RAM)

Check Pause compute capacity: Specify amount of time with no database traffic to scale to zero processing capacity. When database traffic resumes, Aurora automatically resumes processing capacity and scales to handle the traffic.

Data API

Data API was introduced for Amazon Aurora Serverless to deal with the fact that Aurora Serverless is not a long-running program and does not follow the connection-oriented model. This will allow you to quickly and easily execute SQL statements for your Amazon Aurora Serverless Database instances.

Data API is designed for both traditional and serverless apps and will take care of managing and scaling long-term connections.

Press Create database

2. Store your credentials in AWS Secrets Manager

Secret name: aserverlessv2_secret

Press Next until you finally Store the secret

Note your Secret ARN: In this case we have arn:aws:secretsmanager:us-east-1:370365354210:secret:aserverlessv2_secret-zEChfl

3. Connecting to the Database within AWS Console

In the RDS section of the AWS Console, click on the Query Editor

4. Test out Aurora Serverless V2 in the Query Editor:

Test out the creation of

DROP TABLE CloudLog;

CREATE TABLE CloudLog (
Id SERIAL PRIMARY KEY,
Description VARCHAR(255),
Created TIMESTAMP NOT NULL
);

INSERT INTO CloudLog (Description, created) VALUES (‘Some cloud log description’, current_timestamp);

SELECT * FROM CloudLog;

Conclusion

This is very interesting development for databases in having a serverless offering for relational databases. Although currently in preview mode only, I am sure many people will be interested in this as a high value service for their workloads requiring a powerful scalable relational database and reduce costs when not in use.