Difficulty: Intermediate
What is Amazon Redshift used for, and how is it different from a transactional database like RDS?
Amazon Redshift is AWS's managed cloud data warehouse, built for analytical (OLAP) queries over large datasets using standard SQL. It stores data in columns, compresses it heavily, and spreads queries across many nodes in parallel (massively parallel processing), so questions like "revenue by city by week for the last two years" run fast over billions of rows. It is not meant for high-volume single-row inserts and updates; that is what RDS or DynamoDB are for.
| Aspect | RDS (OLTP) | Redshift (OLAP) |
|---|---|---|
| Typical query | Fetch or update one order | Aggregate millions of orders |
| Storage layout | Row-oriented | Column-oriented, compressed |
| Workload | Many small, concurrent transactions | Fewer, large scans and joins |
| Data freshness | Real time | Loaded in batches, micro-batches, or zero-ETL |
| Scaling | Bigger instance, read replicas | More nodes or serverless capacity |
Columnar storage matters because analytical queries usually touch a few columns of very wide tables. Reading only amount and city from a 50-column table skips most of the data on disk, and similar values in a column compress well.
COPY loads files from S3 in parallel; this is the standard bulk load path.AUTO, EVEN, KEY, ALL) controls how rows spread across nodes. Distributing two large tables on the same join key avoids shuffling data between nodes.AUTO is a reasonable default; Redshift adjusts them based on usage.A food delivery company might keep orders in Aurora for the app, replicate them into Redshift with zero-ETL, and run BI dashboards (QuickSight, Tableau, Power BI) for city managers. Common alternatives are Athena (serverless queries directly over S3, best for ad-hoc or infrequent queries), Snowflake, and BigQuery.
CREATE TABLE orders (
order_id BIGINT,
city VARCHAR(50),
amount_paise BIGINT,
ordered_at TIMESTAMP
)
DISTKEY (order_id)
SORTKEY (ordered_at);
-- Parallel bulk load of Parquet files from S3
COPY orders
FROM 's3://analytics-raw/orders/2026/'
IAM_ROLE 'arn:aws:iam::111122223333:role/RedshiftLoadRole'
FORMAT AS PARQUET;
-- Weekly GMV per city for the last 90 days
SELECT city,
DATE_TRUNC('week', ordered_at) AS week,
SUM(amount_paise) / 100.0 AS gmv_rupees
FROM orders
WHERE ordered_at >= DATEADD(day, -90, GETDATE())
GROUP BY 1, 2
ORDER BY 2, 3 DESC;
The sort key on ordered_at lets Redshift skip old blocks for the date filter, and only three columns are read from disk because storage is columnar.
Amazon Redshift, Columnar Storage, MPP, OLAP, Redshift Spectrum