Amazon Redshift

Difficulty: Intermediate

Question

What is Amazon Redshift used for, and how is it different from a transactional database like RDS?

Answer

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.

OLTP vs OLAP

AspectRDS (OLTP)Redshift (OLAP)
Typical queryFetch or update one orderAggregate millions of orders
Storage layoutRow-orientedColumn-oriented, compressed
WorkloadMany small, concurrent transactionsFewer, large scans and joins
Data freshnessReal timeLoaded in batches, micro-batches, or zero-ETL
ScalingBigger instance, read replicasMore 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.

How Redshift executes a query

  • A leader node parses the SQL, builds a plan, and distributes work.
  • Compute nodes (split into slices) scan their share of the data in parallel and return partial results.
  • With RA3 nodes, storage lives in Redshift Managed Storage backed by S3, so you scale compute and storage separately.
  • Redshift Serverless removes node management entirely: you pay for compute in Redshift Processing Units (RPUs) while queries run.

Getting data in, and reaching data outside

  • COPY loads files from S3 in parallel; this is the standard bulk load path.
  • Zero-ETL integrations replicate data from Aurora, RDS, and DynamoDB into Redshift in near real time without writing pipelines.
  • Redshift Spectrum queries data sitting in S3 (Parquet, ORC) through external tables, so you can join warehouse tables with a data lake.
  • Streaming ingestion from Kinesis Data Streams or MSK for near real-time dashboards.

Table design choices that matter

  • Distribution style (AUTO, EVEN, KEY, ALL) controls how rows spread across nodes. Distributing two large tables on the same join key avoids shuffling data between nodes.
  • Sort keys let Redshift skip blocks using zone maps, which speeds up range filters like date ranges.
  • Leaving both on AUTO is a reasonable default; Redshift adjusts them based on usage.

Real-world use

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.

Typical Redshift analytics pipeline. Operational data lands in Redshift, gets queried in parallel, and feeds dashboards.
  1. Aurora, DynamoDB, S3 files: Operational data and raw logs.
  2. COPY or zero-ETL: Bulk loads from S3 or continuous replication.
  3. Redshift leader node: Plans the query and distributes work.
  4. Compute node slices: Scan compressed columns in parallel.
  5. BI dashboards: QuickSight, Tableau, or Power BI.

Code examples

Loading from S3 and running an analytical query

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.

Key points

  • Redshift is a columnar, MPP data warehouse for OLAP, not for OLTP
  • Leader node plans queries; compute nodes and slices execute in parallel
  • RA3 and Redshift Serverless separate compute from managed storage
  • COPY from S3 is the bulk load path; zero-ETL replicates from Aurora, RDS, and DynamoDB
  • Distribution and sort keys control data placement and block skipping

Common follow-up questions

  • What is the difference between Redshift and Athena, and when would you pick each?
  • How do distribution styles affect join performance?
  • Why is columnar storage faster for analytics?
  • What is Redshift Spectrum?

Interview tips

  • Open with OLTP vs OLAP; it frames why Redshift exists
  • Explain columnar storage and MPP mechanically rather than just saying 'it is fast'
  • Mention zero-ETL or Spectrum to show you know the current AWS analytics landscape

Concepts covered

Amazon Redshift, Columnar Storage, MPP, OLAP, Redshift Spectrum

More AWS & Cloud Fundamentals questions