Amazon Redshift Serverless

2 min read serverless, aws, db, redshift

Written in 2022. Tools, APIs and prices may have changed since.

Lab note What I wrote down while learning this by building with it. Short by design; the code is in pfeilbr/amazon-redshift-serverless-playground.

learn Amazon Redshift Serverless

Amazon Redshift Serverless makes it convenient for you to run and scale analytics without having to provision and manage data warehouse clusters. Amazon Redshift automatically provisions and scales data warehouse capacity to deliver fast performance for demanding and unpredictable workloads. You pay only for the capacity that you use.


Concepts

  • Namespace - collection of database objects and users. The storage-related namespace groups together schemas, tables, users, or AWS Key Management Service keys for encrypting data.
  • Workgroup - a collection of compute resources. The compute-related workgroup groups together compute resources like RPUs, VPC subnet groups, and security groups.
    • Other resources that are grouped under workgroups include access and usage limits.

Demo

psql -h workgroup01.123456789012.us-east-1.redshift-serverless.amazonaws.com -d sample_data_dev -p 5439 -U uadmin

# create user
CREATE USER user01 with password 'Password01' createdb connection limit 30;

# redshift serverless costs per day in USD
select
  trunc(start_time) "Day",
  sum(compute_seconds)/60/60 * 0.375
from sys_serverless_usage
group by trunc(start_time)
order by 1

# login as `user01`
psql -h workgroup01.123456789012.us-east-1.redshift-serverless.amazonaws.com -d sample_data_dev -p 5439 -U user01

# list databases
\l

# use database
\c sample_data_dev

# run query
select * from tpcds.customer limit 10;

Screenshots

Serverless Dashboard

Namespace

Workgroup

Workgroup Limits

Data backup

Snapshot

Recovery point


Resources

Keep learning

Get new guides and courses by email

An occasional email when I publish a new guide, course or post. No spam, and you can unsubscribe any time.

Sent with Buttondown. I never share your address. Prefer a feed? Use the RSS feed.