Distributed Data Processing and Pipelines
저자: Trần Quốc Huy

1. Introduction
1.1. Dữ liệu sinh ra từ nhiều nguồn (app, service, IoT)
1.2. Cần hệ thống xử lý dữ liệu phân tán để phân tích, ra quyết định
1.3. Giới thiệu các thành phần chính của data pipeline hiện đại
2. Basic ETL
2.1. ETL = Extract → Transform → Load
2.2. Pandas: phù hợp xử lý nhỏ, file CSV, SQL nhỏ
2.3. Hạn chế: local, memory-bound, không scale
3. Distributed ETL
3.1. Xử lý dữ liệu lớn (GB ~ TB)
3.2. Chia nhỏ dữ liệu và xử lý song song
3.3. Phù hợp cho batch & streaming
4. Distributed ETL Technologies
4.1. Apache Spark – mạnh mẽ cho batch & stream
4.2. Apache Beam – trừu tượng hóa, chạy trên Spark, Flink
4.3. Dask – giống Pandas nhưng song song, scale tốt
5. Data Warehouse
5.1. Lưu trữ dữ liệu đã ETL
5.2. Dạng columnar (OLAP), tối ưu cho phân tích
5.3. Truy vấn đa chiều nhanh
6. Data Warehouse Technologies
6.1. BigQuery – managed, tốc độ cao
6.2. Snowflake – multi-cloud, zero-maintenance
6.3. Redshift, ClickHouse – hiệu quả với dữ liệu lớn
7. Workflow Orchestration
7.1. Điều phối pipeline phức tạp (task A → B → C)
7.2. Quản lý dependency, retry, alert
7.3. Lập lịch (scheduling) cho ETL job
8. Workflow Orchestration Technologies
8.1. Apache Airflow – phổ biến nhất
8.2. Prefect – đơn giản hơn, dễ dev
8.3. Dagster – hướng sản phẩm, typing rõ ràng
9. Stream Processing
9.1. Xử lý dữ liệu real-time
9.2. Thay vì batch → xử lý liên tục
9.3. Dùng trong fraud detection, alerts, personalization
10. Stream Processing Technologies
10.1. Apache Kafka Streams – gần Kafka
10.2. Apache Flink – latency thấp, mạnh về window
10.3. Spark Streaming – dễ tích hợp với batch
11. Querying Data
11.1. Truy vấn từ BI tools, dashboard, app backend
11.2. Hỗ trợ ad-hoc queries
11.3. Yêu cầu: fast, flexible, low-latency
12. Query Engines
12.1. Presto / Trino – open-source, nhiều connector
12.2. Amazon Athena – query S3 trực tiếp
12.3. Druid – dashboard / metrics real-time
13. Practical Example (AWS Stack)
13.1. Context: Hệ thống phân tích dữ liệu cho nền tảng học trực tuyến
13.2. Ingestion
13.2.1. CloudFront + S3: lưu logs người dùng, video access
13.2.2. AWS Kinesis Data Streams: stream logs real-time từ ứng dụng web/app
13.3. ETL (Batch + Stream)
13.3.1. AWS Glue
13.3.1.1. Extract logs từ S3
13.3.1.2. Transform bằng Spark scripts (Python/Scala)
13.3.1.3. Load vào Redshift hoặc S3 (dạng columnar: Parquet)
13.3.2. AWS Lambda: xử lý light transformation trong Kinesis stream
13.4. Storage & Data Warehouse
13.4.1. Amazon S3: raw & transformed data (dùng format Parquet, partitioned)
13.4.2. Amazon Redshift: lưu dữ liệu đã clean để phục vụ analytics
13.5. Stream Processing
13.5.1. Amazon Kinesis Data Analytics (SQL)
13.5.2. Lambda + Kinesis: detect anomaly, ghi log lỗi vào DLQ (SQS + Lambda)
13.6. Query Layer / Analytics
13.6.1. Amazon Athena: truy vấn dữ liệu trên S3
13.6.2. Amazon QuickSight: dashboard real-time cho team content/marketing