AWS Learning
Database

Amazon Redshift

Data Warehouse, OLAP, Columnar Storage, MPP, Spectrum, Zero-ETL

Redshift là gì?

Amazon Redshift là dịch vụ Data Warehouse được quản lý hoàn toàn bởi AWS, được thiết kế cho OLAP (Online Analytical Processing) - phân tích dữ liệu lớn với quy mô petabyte.

┌─────────────────────────────────────────────────────────────────────┐
│                    Data Warehouse Concept                           │
│                                                                     │
│   OLTP (Transactional)              OLAP (Analytical)               │
│   ─────────────────────              ──────────────────             │
│   - INSERT, UPDATE, DELETE           - SELECT, aggregate            │
│   - Nhiều transaction nhỏ            - Ít query nhưng phức tạp      │
│   - RDS, Aurora, DynamoDB            - Redshift, Athena             │
│                                                                     │
│   ┌──────────────────┐              ┌──────────────────┐            │
│   │  App Database    │   ──ETL──►   │  Data Warehouse  │            │
│   │  (OLTP)          │              │  (OLAP)          │            │
│   │                  │              │                  │            │
│   │  Orders          │              │  Analytics       │            │
│   │  Customers       │              │  Reports         │            │
│   │  Products        │              │  BI Dashboard    │            │
│   └──────────────────┘              └──────────────────┘            │
│                                                                     │
└─────────────────────────────────────────────────────────────────────┘

Đặc điểm chính

Đặc điểmMô tả
Columnar StorageLưu trữ theo cột, tối ưu cho query analytical
MPP (Massively Parallel Processing)Xử lý song song trên nhiều node
Petabyte ScaleXử lý dữ liệu từ GB đến PB
SQL CompatibleDùng PostgreSQL-compatible SQL
BI IntegrationTích hợp với QuickSight, Tableau, Power BI...
Data LakehouseKết hợp data lake (S3) + data warehouse

Columnar vs Row Storage

ROW-BASED STORAGE (OLTP - RDS, Aurora):
┌──────┬────────┬─────────┬────────┐
│ ID   │ Name   │ Amount  │ Date   │
├──────┼────────┼─────────┼────────┤
│ 1    │ Alice  │ 100     │ Jan    │ ← Row 1
│ 2    │ Bob    │ 200     │ Feb    │ ← Row 2
│ 3    │ Carol  │ 150     │ Mar    │ ← Row 3
└──────┴────────┴─────────┴────────┘
→ Tốt cho: SELECT * FROM orders WHERE id = 1

COLUMNAR STORAGE (OLAP - Redshift):
┌──────────────────────────────────────┐
│ ID Column:     [1, 2, 3, ...]        │ ← Đọc riêng
│ Name Column:   [Alice, Bob, Carol]   │
│ Amount Column: [100, 200, 150, ...]  │ ← Chỉ đọc cột này
│ Date Column:   [Jan, Feb, Mar, ...]  │
└──────────────────────────────────────┘
→ Tốt cho: SELECT SUM(amount) FROM orders
→ Chỉ đọc 1 cột thay vì toàn bộ row
→ Compression tốt hơn (dữ liệu cùng type)

Kiến trúc Redshift

Cluster Architecture

┌───────────────────────────────────────────────────────────────────────────────────────────────────┐
│                        Redshift Cluster                                                           │
│                                                                                                   │
│   ┌─────────────────────────────────────────────────────────────┐                                 │
│   │                      LEADER NODE                                                          │   │
│   │                                                                                           │   │
│   │  - Nhận query từ client                                                                   │   │
│   │  - Parse và optimize query                                                                │   │
│   │  - Tạo execution plan                                                                     │   │
│   │  - Phân phối task đến compute nodes                                                       │   │
│   │  - Aggregate kết quả                                                                      │   │
│   │  - Trả về kết quả cho client                                                              │   │
│   └─────────────────────────────────────────────────────────────┘                                 │
│                                                           │                                       │
│              ┌───────────────┼───────────────┐                                                    │
│              │               │                                             │                      │
│              ▼               ▼               ▼                                                    │
│   ┌───────────────┐ ┌───────────────┐ ┌───────────────┐                                           │
│   │ COMPUTE NODE 1│ │ COMPUTE NODE 2│ │ COMPUTE NODE 3                               │            │
│   │               │ │               │ │                                              │            │
│   │ ┌───────────┐ │ │ ┌───────────┐ │ │ ┌───────────┐                                │            │
│   │ │  Slice 1  │ │ │ │  Slice 1  │ │ │ │  Slice 1  │                                │            │
│   │ │  Slice 2  │ │ │ │  Slice 2  │ │ │ │  Slice 2  │                                │            │
│   │ └───────────┘ │ │ └───────────┘ │ │ └───────────┘                                │            │
│   │               │ │               │ │                                              │            │
│   │  Store data   │ │  Store data   │ │  Store data                                  │            │
│   │  Execute      │ │  Execute      │ │  Execute                                     │            │
│   │  queries      │ │  queries      │ │  queries                                     │            │
│   └───────────────┘ └───────────────┘ └───────────────┘                                           │
│                                                                                                   │
│                    Redshift Managed Storage (RMS)                                                 │
│              ┌───────────────────────────────┐                                                    │
│              │                         Amazon S3                           │                      │
│              │              (Durable storage cho RA3 nodes)                │                      │
│              └───────────────────────────────┘                                                    │
└───────────────────────────────────────────────────────────────────────────────────────────────────┘

Thành phần chính

ComponentMô tả
Leader NodeNhận query, optimize, phân phối task, aggregate kết quả
Compute NodesLưu trữ data, thực thi query song song
SlicesPhân vùng nhỏ trong mỗi compute node, xử lý độc lập
Redshift Managed Storage (RMS)S3-backed storage cho RA3 nodes

Provisioned vs Serverless

So sánh

Tiêu chíProvisionedServerless
Quản lýBạn chọn số lượng, type nodeAWS tự động quản lý
ScalingManual hoặc Elastic ResizeTự động scale
BillingPer node-hourPer RPU-second
Use caseWorkload ổn định, predictableVariable, unpredictable workload
SetupPhức tạp hơnĐơn giản, nhanh
Reserved pricing✅ Có (lên đến 75% discount)✅ Có (lên đến 24% discount)

Provisioned Cluster

┌─────────────────────────────────────────────────────────────────┐
│                     PROVISIONED CLUSTER                         │
│                                                                 │
│   ┌─────────────┐  ┌─────────────┐  ┌─────────────┐             │
│   │ ra3.xlplus  │  │ ra3.xlplus  │  │ ra3.xlplus  │             │
│   │    Node 1   │  │    Node 2   │  │    Node 3   │             │
│   └─────────────┘  └─────────────┘  └─────────────┘             │
│                                                                 │
│   Chi phí: $1.086/hour × 3 nodes = $3.258/hour                  │
│   Luôn chạy 24/7 dù không query                                 │
│                                                                 │
│   ✅ Predictable cost                                           │
│   ✅ Reserved Instances discount (up to 75%)                    │
│   ❌ Trả tiền khi idle                                          │
└─────────────────────────────────────────────────────────────────┘

Serverless

┌─────────────────────────────────────────────────────────────────┐
│                     REDSHIFT SERVERLESS                         │
│                                                                 │
│   Workload ─────► ┌───────────────────────────────┐             │
│                   │  AWS tự động provision        │             │
│                   │  8 RPU ──► 128 RPU ──► 8 RPU  │             │
│                   │           (scale)             │             │
│                   └───────────────────────────────┘             │
│                                                                 │
│   RPU = Redshift Processing Unit                                │
│   Chi phí: $0.375/RPU-hour (us-east-1)                          │
│   Base 8 RPU = $3.00/hour khi active                            │
│                                                                 │
│   ✅ Chỉ trả khi query                                          │
│   ✅ Auto scaling                                               │
│   ✅ Không cần quản lý infrastructure                           │
│   ❌ Có thể đắt hơn với workload ổn định 24/7                   │
└─────────────────────────────────────────────────────────────────┘

Khi nào chọn cái nào?

Tình huốngRecommendation
Workload 24/7, ổn định🏆 Provisioned + Reserved
Workload peak hours (8h/ngày)🏆 Serverless
POC, development, testing🏆 Serverless
Unpredictable workload🏆 Serverless
Budget hạn chế, cần optimizeTính toán so sánh

Node Types

┌─────────────────────────────────────────────────────────────────┐
│                          RA3 NODES                              │
│                    (Managed Storage - RMS)                      │
│                                                                 │
│   ┌─────────────┐                     ┌─────────────────────┐   │
│   │ RA3 Node    │◄── Hot data ──────► │ Local SSD Cache     │   │
│   │             │                     │ (Fast access)       │   │
│   │             │◄── Warm/Cold ─────► │ Amazon S3 (RMS)     │   │
│   │             │     data            │ (Unlimited storage) │   │
│   └─────────────┘                     └─────────────────────┘   │
│                                                                 │
│   ✅ Compute và Storage scale độc lập                           │
│   ✅ Chỉ trả storage theo GB thực tế dùng                       │
│   ✅ Automatic data tiering                                     │
└─────────────────────────────────────────────────────────────────┘
Node TypevCPUMemoryStoragePrice/hour
ra3.xlplus432 GBRMS~$1.086
ra3.4xlarge1296 GBRMS~$3.26
ra3.16xlarge48384 GBRMS~$13.04

DC2 Nodes (Dense Compute)

┌─────────────────────────────────────────────────────────────────┐
│                          DC2 NODES                              │
│                     (Local SSD Storage)                         │
│                                                                 │
│   ┌─────────────────────────────────────────────┐               │
│   │ DC2 Node                                    │               │
│   │                                             │               │
│   │  ┌─────────────────────────────────────┐    │               │
│   │  │        Local NVMe SSD                │   │               │
│   │  │        (Fixed storage per node)      │   │               │
│   │  └─────────────────────────────────────┘    │               │
│   └─────────────────────────────────────────────┘               │
│                                                                 │
│   ✅ Fastest performance (all data local)                       │
│   ✅ Tốt cho datasets < 1TB uncompressed                        │
│   ❌ Storage fixed, scale bằng cách thêm nodes                  │
└─────────────────────────────────────────────────────────────────┘
Node TypevCPUMemoryStoragePrice/hour
dc2.large215 GB160 GB SSD~$0.25
dc2.8xlarge32244 GB2.56 TB SSD~$4.80

Chọn node nào?

Tiêu chíRecommendation
Data < 1TB, performance criticalDC2
Data growing, cần flexibilityRA3 (recommended)
Muốn scale compute riêng storageRA3
Budget limited, small datasetDC2.large

Data Distribution và Sort Keys

Distribution Styles

Cách Redshift phân phối data giữa các nodes quyết định performance của JOIN và aggregation.

┌─────────────────────────────────────────────────────────────────┐
│                    DISTRIBUTION STYLES                          │
│                                                                 │
│  1. KEY Distribution                                            │
│  ─────────────────────                                          │
│     Rows với cùng key value → cùng node                         │
│     Tốt cho: JOIN trên cùng key                                 │
│                                                                 │
│     ┌─────────┐    ┌─────────┐    ┌─────────┐                   │
│     │ Node 1  │    │ Node 2  │    │ Node 3  │                   │
│     │ key=A   │    │ key=B   │    │ key=C   │                   │
│     │ key=A   │    │ key=B   │    │ key=C   │                   │
│     └─────────┘    └─────────┘    └─────────┘                   │
│                                                                 │
│  2. ALL Distribution                                            │
│  ─────────────────────                                          │
│     Copy toàn bộ table đến mọi node                             │
│     Tốt cho: Dimension tables nhỏ                               │
│                                                                 │
│     ┌─────────┐    ┌─────────┐    ┌─────────┐                   │
│     │ Full    │    │ Full    │    │ Full    │                   │
│     │ table   │    │ table   │    │ table   │                   │
│     │ copy    │    │ copy    │    │ copy    │                   │
│     └─────────┘    └─────────┘    └─────────┘                   │
│                                                                 │
│  3. EVEN Distribution (default)                                 │
│  ─────────────────────                                          │
│     Round-robin phân đều rows                                   │
│     Tốt cho: Tables không JOIN thường xuyên                     │
│                                                                 │
│  4. AUTO Distribution                                           │
│  ─────────────────────                                          │
│     Redshift tự chọn EVEN hoặc ALL                              │
│     Recommended: Để Redshift quyết định                         │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Sort Keys

┌─────────────────────────────────────────────────────────────────┐
│                        SORT KEYS                                │
│                                                                 │
│  Compound Sort Key:                                             │
│  ─────────────────────                                          │
│  SORTKEY (date, region, product_id)                             │
│                                                                 │
│  Data sorted: date → region → product_id                        │
│  ✅ Tốt khi filter theo thứ tự: date, hoặc date+region          │
│  ❌ Không hiệu quả nếu chỉ filter region                        │
│                                                                 │
│  Interleaved Sort Key:                                          │
│  ─────────────────────                                          │
│  INTERLEAVED SORTKEY (date, region, product_id)                 │
│                                                                 │
│  ✅ Filter theo bất kỳ column nào đều hiệu quả                  │
│  ❌ Chậm hơn khi load data                                      │
│  ❌ Cần VACUUM thường xuyên                                     │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Best Practices

ScenarioRecommendation
Time-series dataCompound sort key (date first)
Multi-dimension filteringInterleaved sort key
Large fact table JOINKEY distribution (join column)
Small dimension tableALL distribution
Don't knowAUTO (let Redshift decide)

Redshift Spectrum

Redshift Spectrum cho phép query data trực tiếp trên S3 mà không cần load vào Redshift.

┌─────────────────────────────────────────────────────────────────┐
│                      REDSHIFT SPECTRUM                          │
│                                                                 │
│   ┌───────────────┐                                             │
│   │ Redshift      │                                             │
│   │ Cluster       │                                             │
│   │               │   SELECT * FROM                             │
│   │               │   spectrum_schema.s3_table                  │
│   │               │   WHERE date > '2024-01-01'                 │
│   └───────┬───────┘                                             │
│          │                                                      │
│           ▼                                                     │
│   ┌───────────────────────────────────────────────┐             │
│   │            Spectrum Layer                     │             │
│   │  (Thousands of nodes for parallel processing) │             │
│   └───────────────────────────────────────────────┘             │
│          │                                                      │
│           ▼                                                     │
│   ┌─────────────────────────────────────────────────────────┐   │
│   │                      Amazon S3                          │   │
│   │                                                         │   │
│   │  s3://my-bucket/data/                                   │   │
│   │  ├── sales/                                             │   │
│   │  │   ├── year=2024/month=01/ (Parquet, ORC, JSON, CSV)  │   │
│   │  │   ├── year=2024/month=02/                            │   │
│   │  │   └── ...                                            │   │
│   │  └── customers/                                         │   │
│   └─────────────────────────────────────────────────────────┘   │
│                                                                 │
│   Chi phí: $5.00 / TB data scanned                              │
│                                                                 │
│   ✅ Query data trực tiếp trên S3                               │
│   ✅ Không cần load data vào Redshift                           │
│   ✅ Tiết kiệm storage cost                                     │
│   ✅ Partition pruning (chỉ scan partitions cần thiết)          │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Khi nào dùng Spectrum?

ScenarioRecommendation
Historical data, ít query🏆 Spectrum (S3)
Hot data, query thường xuyênRedshift tables
Data lake integration🏆 Spectrum
Ad-hoc exploration🏆 Spectrum

Zero-ETL Integration

Zero-ETL là tính năng mới cho phép replicate data từ operational databases vào Redshift tự động, không cần xây dựng ETL pipeline.

┌─────────────────────────────────────────────────────────────────┐
│                       ZERO-ETL INTEGRATION                      │
│                                                                 │
│   ┌───────────────┐         Automatic         ┌───────────────┐ │
│   │               │         Replication       │               │ │
│   │    Aurora     │ ══════════════════════════►│   Redshift   │ │
│   │   MySQL       │                           │               │ │
│   │   PostgreSQL  │   - No ETL code needed    │   Analytics   │ │
│   │               │   - Near real-time        │   & BI        │ │
│   └───────────────┘   - Incremental sync      └───────────────┘ │
│                                                                 │
│   ┌───────────────┐         Automatic         ┌───────────────┐ │
│   │    RDS for    │ ══════════════════════════►│   Redshift   │ │
│   │    MySQL      │                           │               │ │
│   └───────────────┘                           └───────────────┘ │
│                                                                 │
│   ┌───────────────┐         Automatic         ┌───────────────┐ │
│   │   DynamoDB    │ ══════════════════════════►│   Redshift   │ │
│   │               │                           │               │ │
│   └───────────────┘                           └───────────────┘ │
│                                                                 │
│   ✅ Không cần viết ETL code                                    │
│   ✅ Near real-time analytics                                   │
│   ✅ Automatic schema sync                                      │
│   ✅ Không có phí riêng (chỉ trả Redshift + source DB)          │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Supported Sources

SourceStatus
Amazon Aurora MySQL✅ GA
Amazon Aurora PostgreSQL✅ GA
Amazon RDS for MySQL✅ GA
Amazon DynamoDB✅ GA

Concurrency Scaling

Concurrency Scaling tự động thêm capacity khi có quá nhiều concurrent queries.

┌─────────────────────────────────────────────────────────────────┐
│                    CONCURRENCY SCALING                          │
│                                                                 │
│   Normal Load:                                                  │
│   ┌─────────────┐                                               │
│   │ Main Cluster│◄── 10 queries ──► OK                          │
│   └─────────────┘                                               │
│                                                                 │
│   Peak Load (queue building up):                                │
│   ┌─────────────┐         ┌─────────────────────────────┐       │
│   │ Main Cluster│         │ Concurrency Scaling Cluster │       │
│   │             │◄── 50 queries ───►                    │       │
│   │             │    Auto offload   │ Temporary cluster │       │
│   └─────────────┘         │ (scale out)                 │       │
│                                     └─────────────────────┘     │
│                                                                 │
│   ✅ Tự động, không cần cấu hình                                │
│   ✅ 1 giờ miễn phí/ngày cho hầu hết clusters                   │
│   💰 Sau đó tính theo on-demand rate                            │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Data Sharing

Data Sharing cho phép chia sẻ data giữa các Redshift clusters/serverless mà không cần copy data.

┌─────────────────────────────────────────────────────────────────┐
│                        DATA SHARING                             │
│                                                                 │
│   Producer Cluster                    Consumer Clusters         │
│   (Account A)                         (Account A, B, C)         │
│                                                                 │
│   ┌─────────────────┐                ┌─────────────────┐        │
│   │                 │   Datashare    │  BI Cluster     │        │
│   │   Production    │ ──────────────►│  (Read-only)    │        │
│   │   Warehouse     │                └─────────────────┘        │
│   │                │                                            │
│   │   "Main data"   │                ┌─────────────────┐        │
│   │                 │   Datashare    │  Data Science   │        │
│   │                 │ ──────────────►│  Cluster        │        │
│   └─────────────────┘                └─────────────────┘        │
│                                                                 │
│   ✅ Live data (không copy)                                     │
│   ✅ Cross-account, cross-region                                │
│   ✅ Consumer trả compute, Producer giữ data                    │
│   ✅ Granular access control                                    │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Use Cases

ScenarioGiải thích
Multi-tenant SaaSMỗi tenant có cluster riêng, đọc từ shared data
BI vs ETL separationBI team đọc từ shared data, không ảnh hưởng ETL
Cross-account analyticsShare data với partners, subsidiaries

Redshift ML

Redshift ML cho phép train và deploy ML models trực tiếp trong Redshift bằng SQL.

-- 1. Create model
CREATE MODEL customer_churn_model
FROM training_data
TARGET churn
FUNCTION predict_churn
IAM_ROLE 'arn:aws:iam::123456789:role/RedshiftML';
 
-- 2. Use model in queries
SELECT customer_id, 
       predict_churn(customer_id, tenure, monthly_charges)
FROM customers
WHERE predict_churn(...) = 1;
FeatureMô tả
AutoMLTự động chọn algorithm, tune hyperparameters
Bring Your Own ModelImport models từ SageMaker
SQL InterfaceKhông cần biết Python/ML frameworks
Pricing$20/million cells (first 10M)

Bảo mật

Security Features

┌─────────────────────────────────────────────────────────────────┐
│                      REDSHIFT SECURITY                          │
│                                                                 │
│   Network Security:                                             │
│   ─────────────────                                             │
│   ┌─────────────────────────────────────────────┐               │
│   │                    VPC                      │               │
│   │  ┌─────────────────────────────────────┐    │               │
│   │  │          Private Subnet              │   │               │
│   │  │  ┌─────────────────────────────┐    │    │               │
│   │  │  │    Redshift Cluster          │    │   │               │
│   │  │  │    (No public access)        │    │   │               │
│   │  │  └─────────────────────────────┘    │    │               │
│   │  │              │                       │   │               │
│   │  │              ▼                       │   │               │
│   │  │       Security Group                 │   │               │
│   │  │    (Port 5439 from app)              │   │               │
│   │  └─────────────────────────────────────┘    │               │
│   └─────────────────────────────────────────────┘               │
│                                                                 │
│   Encryption:                                                   │
│   ─────────────────                                             │
│   - At rest: AES-256 (KMS or HSM)                               │
│   - In transit: SSL/TLS                                         │
│                                                                 │
│   Access Control:                                               │
│   ─────────────────                                             │
│   - IAM for cluster management                                  │
│   - Database users/groups for data access                       │
│   - Row-level security (RLS)                                    │
│   - Column-level security (Dynamic Data Masking)                │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Access Control Options

FeatureMô tả
IAM Integrationauthenticate với IAM users/roles
AWS IAM Identity CenterSSO cho federated users
Row-Level SecurityFilter rows based on user
Column-Level SecurityGrant access đến specific columns
Dynamic Data MaskingMask sensitive data (PII, etc.)

Chi phí

Provisioned Pricing (us-east-1)

Node TypeOn-Demand/hour1-yr Reserved3-yr Reserved
dc2.large$0.25$0.145 (-42%)$0.063 (-75%)
ra3.xlplus$1.086$0.63 (-42%)$0.27 (-75%)
ra3.4xlarge$3.26$1.89 (-42%)$0.82 (-75%)

Managed Storage (RMS): $0.024/GB-month

Serverless Pricing

ComponentPrice
RPU-hour~$0.375 (base 8 RPU = $3/hour)
Managed Storage$0.024/GB-month
SpectrumIncluded in RPU
Concurrency ScalingIncluded in RPU

Ví dụ tính chi phí

Provisioned (2 x ra3.xlplus, 24/7):

On-Demand:
  $1.086 × 2 nodes × 24h × 30 days = $1,563/month
  + Storage 1TB: $0.024 × 1000 = $24/month
  Total: ~$1,587/month

3-year Reserved:
  $0.27 × 2 × 24 × 30 = $389/month
  + Storage: $24/month
  Total: ~$413/month (74% savings!)

Serverless (8 hours/day, 8 RPU base):

  $0.375 × 8 RPU × 8 hours × 22 workdays = $528/month
  + Storage 1TB: $24/month
  Total: ~$552/month

So sánh với các dịch vụ khác

Redshift vs Athena vs RDS

Tiêu chíRedshiftAthenaRDS
TypeData WarehouseServerless QueryOLTP Database
Use caseBI, AnalyticsAd-hoc queries on S3Transactions
Data sizeGB - PBGB - PB (S3)GB - TB
LatencySecondsSeconds - MinutesMilliseconds
PricingNode-hours / RPUPer query ($5/TB)Instance hours
ETL needed✅ Yes (load data)❌ No (query S3 directly)N/A
ConcurrencyHighModerateVery High

Khi nào dùng gì?

ScenarioRecommendation
Complex BI dashboards, reporting🏆 Redshift
Ad-hoc queries on S3 data lake🏆 Athena
Application database🏆 RDS / Aurora
Real-time analyticsKinesis + Redshift
Data exploration, occasional queries🏆 Athena
Predictable, heavy analytics workload🏆 Redshift Provisioned

Best Practices

Design

PracticeGiải thích
Chọn Sort Key đúngDựa trên WHERE clause phổ biến nhất
Chọn Distribution Key đúngDựa trên JOIN conditions
Dùng RA3 nodesTách compute & storage, flexibility
Compress dataAutomatic, nhưng analyze compression

Performance

PracticeGiải thích
VACUUM regularlySau DELETE/UPDATE để reclaim space
ANALYZE tablesUpdate statistics cho query optimizer
Use Workload Management (WLM)Prioritize queries, set timeouts
Monitor with CloudWatchQuery performance, disk space, CPU

Cost Optimization

PracticeGiải thích
Reserved InstancesLên đến 75% savings cho steady workload
Pause clusterKhi không dùng (dev/test)
Use SpectrumCho cold data thay vì load vào Redshift
Right-size nodesMonitor và resize nếu underutilized

Exam Tips

Key Points

💡 Redshift = Data Warehouse = OLAP = Analytics

Keyword trong đềNghĩ đến
Data warehouse, analytics, BIRedshift
Petabyte scale analyticsRedshift
OLAP, complex queriesRedshift
Columnar storageRedshift
MPP (Massively Parallel Processing)Redshift
Query S3 data lakeRedshift Spectrum hoặc Athena
Real-time dashboardRedshift (với materialized views)
ETL from Aurora/RDSZero-ETL hoặc Glue

So sánh nhanh

ScenarioService
"Data warehouse for BI"Redshift
"Ad-hoc queries on S3"Athena
"Transactional database"RDS/Aurora
"Real-time streaming analytics"Kinesis Data Analytics
"ETL jobs"Glue
"Serverless data warehouse"Redshift Serverless

Gotchas

TrapSự thật
"Redshift là database?"❌ Là Data Warehouse (OLAP), không phải OLTP
"Redshift auto-scales?"Provisioned: ❌ Manual, Serverless: ✅ Auto
"Spectrum cần load data?"❌ Query trực tiếp trên S3
"Redshift chạy trong VPC?"✅ Luôn trong VPC

Tài liệu tham khảo