Amazon Redshift
Go deep on Redshift: provisioned and serverless options, distribution and sort keys, COPY from S3, Spectrum and workload management.
Intermediate · about 8 hours · difficulty 3/5
Learn first: How Cloud Data Warehouses Work
Amazon Redshift is AWS's data warehouse and is common in companies already built on AWS. Pick it if your target roles are AWS-heavy.
Deployment options
- Provisioned clusters with RA3 nodes (managed storage separate from compute).
- Redshift Serverless: pay for compute used, no cluster sizing. Easier for learning; check the free trial credits.
Table design matters more here
- Distribution style decides how rows spread across nodes:
KEY(co-locate rows with the same join key),ALL(copy small dimensions to every node),EVEN, orAUTO. - Sort keys order data on disk so range filters skip blocks (zone maps).
- Good choices avoid data movement during joins; poor ones cause slow, shuffle-heavy queries.
- Recent versions automate much of this (
AUTOdistribution and sort), but interviewers still ask.
Loading and querying
COPYfrom S3 in parallel; split input into multiple files.- Redshift Spectrum queries Parquet in S3 directly through the Glue Data Catalog.
VACUUMandANALYZEmaintain sort order and statistics (largely automatic now).- Workload management (WLM) and concurrency scaling manage many simultaneous queries.
Pitfalls
- Choosing a distribution key with skewed values, putting most data on one node.
- Loading with many single-row INSERTs instead of COPY.
You are ready to move on when you can design distribution and sort keys for a fact and two dimensions, load them with COPY from S3, and use EXPLAIN to confirm joins avoid redistribution.
Key concepts
- Provisioned vs Serverless
- Distribution styles
- Sort keys and zone maps
- COPY from S3
- Redshift Spectrum
- VACUUM and ANALYZE
- Workload management
Other options for this step
- Snowflake: Go deep on Snowflake: virtual warehouses, micro-partitions, stages and COPY, time travel, zero-copy cloning, roles and cost controls.
- Google BigQuery: Go deep on BigQuery: serverless execution, slots and bytes-scanned pricing, partitioning and clustering, nested and repeated fields, and cost controls.
Mini project
Using Redshift Serverless trial credits, load a star schema from S3 with COPY. Try two distribution designs for the fact table, run the same join query and compare EXPLAIN plans and runtimes. Pause or delete resources afterwards.
Check yourself
Why would you use DISTSTYLE ALL for a small city dimension but not for the orders fact table?
Free resources
- Amazon Redshift documentation (AWS)
- AWS Skill Builder (AWS)