AWS Redshift
Amazon Redshift is a managed data warehouse. It stores huge volumes of structured data and answers analytical questions fast. Business teams use it to study sales trends, customer behavior, and operational reports across years of records.
Picture two kinds of stores. A corner shop handles thousands of small purchases each day. A research library holds decades of records and answers big questions like "which products grew every winter for ten years." A regular database behaves like the corner shop. Redshift behaves like the research library.
OLTP and OLAP
- OLTP (Online Transaction Processing) handles many small reads and writes, such as placing an order. RDS and DynamoDB fit this job.
- OLAP (Online Analytical Processing) scans millions of rows to produce summaries. Redshift fits this job.
How Redshift Works
Redshift uses columnar storage and massively parallel processing. Columnar storage keeps each column together, so a query reads only the columns it needs. Parallel processing splits a query across many nodes that work at the same time.
SQL Query from BI tool
|
v
+-------------+
| Leader Node | plans the query
+------+------+
|
+-------------+-------------+
| | |
+-----+----+ +-----+----+ +-----+----+
| Compute | | Compute | | Compute |
| Node 1 | | Node 2 | | Node 3 |
| slice | | slice | | slice |
+----------+ +----------+ +----------+
\ | /
Results combine and return
Deployment Options
- Provisioned clusters: you choose node types and counts, and you pay for the running time.
- Redshift Serverless: AWS adjusts capacity automatically, and you pay for the compute used while queries run.
Serverless suits teams that want to start quickly without sizing clusters. Provisioned clusters suit steady, predictable workloads.
Loading Data
Data arrives from many sources: S3 files, RDS databases, DynamoDB tables, and streaming feeds. The COPY command loads files from S3 in parallel and ranks as the fastest way to bring in large data sets.
COPY sales FROM 's3://my-bucket/sales/2025/' IAM_ROLE 'arn:aws:iam::123456789012:role/RedshiftLoadRole' FORMAT AS PARQUET;
Data Flow in a Typical Analytics Setup
Source Systems Staging Warehouse Reports +---------------+ +-----------+ +-------------+ +-----------+ | RDS, Apps, | --> | S3 bucket | --> | Redshift |-->| Dashboards| | Logs, Files | | (raw data)| COPY | (tables) | | and BI | +---------------+ +-----------+ +-------------+ +-----------+
Redshift Spectrum
Spectrum queries files in S3 directly from Redshift without loading them first. Keep rarely used history in S3 at low cost, and join it with fresh warehouse tables in a single query.
Design Choices That Affect Speed
Distribution Style
The distribution style decides how rows spread across nodes. A key distribution places matching rows from two large tables on the same node, which reduces data movement during joins. An ALL distribution copies a small table to every node. The AUTO setting lets Redshift choose.
Sort Keys
A sort key orders data on disk. Queries that filter by date read only the relevant blocks when the table sorts by date.
Compression
Redshift compresses columns automatically, which cuts storage use and speeds up reads.
Example Query
SELECT product_category, SUM(revenue) AS total_revenue FROM sales WHERE sale_date BETWEEN '2025-01-01' AND '2025-12-31' GROUP BY product_category ORDER BY total_revenue DESC;
Security
- Launch clusters inside a VPC and restrict access with security groups.
- Encrypt data at rest with KMS and in transit with SSL.
- Grant users only the schemas and tables they need.
- Turn on audit logging for connection and query activity.
Redshift Compared With Athena
- Athena queries files in S3 with no infrastructure and suits occasional questions.
- Redshift serves heavy, repeated workloads and many concurrent dashboard users.
Best Practices
- Load data in large batches instead of many single-row inserts.
- Run maintenance commands such as VACUUM and ANALYZE when the engine does not run them automatically.
- Pause or delete test clusters after practice, since running clusters bill by the hour.
- Use workload management to keep short dashboard queries from waiting behind long reports.
