Snowflake, BigQuery & Databricks · Amazon Redshift

Redshift Spectrum external tables

awsEasyredshiftspectrumexternal-tabless3-lake

Interview question

What is Redshift Spectrum, and when would you use it instead of loading data?

How to answer

The short answer

Redshift Spectrum is a feature of Amazon Redshift that allows you to query data directly in Amazon S3 without loading it into Redshift cluster storage. It bridges the data lake and the warehouse.

How Spectrum works

You register your S3 files in the AWS Glue as external tables. In Redshift, you create an external schema pointing to that Glue database. You can then run standard SQL queries that join fast local warehouse tables on solid-state drives with terabytes of historical data sitting in S3.

The queries are executed by a fleet of thousands of serverless compute workers managed by AWS, not by your cluster nodes. Your Redshift cluster only aggregates the final result sets returned by the Spectrum workers.

When to use Spectrum

  • Historical archive data: You keep the last 90 days of transactions inside local Redshift tables for sub-second dashboard performance, and leave 7 years of older transaction history in S3 Parquet .
  • Ad-hoc exploratory analysis: Analysts can inspect raw or silver files without waiting for a data engineer to write a production COPY pipeline.
  • Cost optimization: Spectrum charges a pay-per-scan fee (currently $5.00 per terabyte scanned, check current pricing). By partitioning S3 data and storing it in Parquet, Spectrum scans only relevant columns and partitions.