Amazon Redshift là petabyte-scale data warehouse dựa trên columnar storage, tối ưu cho OLAP (Online Analytical Processing) — complex queries trên large datasets, reporting, BI. Khác biệt với OLTP (RDS): Redshift lưu data theo cột thay vì hàng, giúp compression tốt hơn và scan nhanh hơn khi chỉ cần một số cột trong query analytic.
Redshift cluster gồm: 1 leader node (parse/plan query, coordinate) + nhiều compute nodes (lưu data, thực thi query); Redshift Serverless tự động scale.
Distribution styles quyết định data phân phối thế nào:
- EVEN — phân phối đều qua tất cả nodes, tốt khi không có JOIN
- KEY — phân phối theo giá trị của column, tốt khi JOIN thường xuyên trên column đó (co-locate related data)
- ALL — copy toàn bộ table vào mọi node, chỉ dùng cho dimension tables nhỏ
- AUTO — Redshift tự chọn
Sort keys giúp range scan hiệu quả (như index trong traditional DB). Redshift Spectrum cho phép query data trực tiếp trên S3 (data lake) mà không cần load vào Redshift — pay per query. Materialized views cho pre-computed aggregation. Redshift phù hợp: business reporting, historical data analysis, data lake queries; không phù hợp: OLTP, nhiều small updates, NoSQL flexible schema.
Amazon Redshift is a petabyte-scale data warehouse built on columnar storage, optimized for OLAP (Online Analytical Processing) — complex queries over large datasets, reporting, and BI. Unlike OLTP (RDS): Redshift stores data by column rather than by row, enabling better compression and faster scans when only a few columns are needed in analytical queries.
A Redshift cluster consists of 1 leader node (parses/plans queries, coordinates) plus multiple compute nodes (store data, execute queries); Redshift Serverless auto-scales.
Distribution styles determine how data is distributed:
- EVEN — distributes data evenly across all nodes, good when there are no JOINs
- KEY — distributes by column value, good when frequently joining on that column (co-locates related data)
- ALL — copies the entire table to every node, only for small dimension tables
- AUTO — Redshift chooses automatically
Sort keys enable efficient range scans (similar to indexes in traditional databases). Redshift Spectrum allows querying data directly on S3 (data lake) without loading it into Redshift — pay per query. Materialized views support pre-computed aggregations. Redshift is suitable for: business reporting, historical data analysis, and data lake queries; not suitable for: OLTP, many small updates, or NoSQL flexible schemas.