Đang tải

Introduction to Data Engineering

Vincent Vankrunkelsven

Data Engineer, DataCamp

Cơ sở dữ liệu phân tích hay ứng dụng

Phân tích

Biểu tượng đại diện cho phân tích

  • Truy vấn tổng hợp
  • Xử lý phân tích trực tuyến (OLAP)

Ứng dụng

Biểu tượng đại diện cho ứng dụng

  • Nhiều giao dịch
  • Xử lý giao dịch trực tuyến (OLTP)
Introduction to Data Engineering

Hướng cột và hướng hàng

Phân tích

  • Hướng cột

Ví dụ về lưu trữ theo cột

  • Truy vấn theo tập con cột
  • Song song hóa

Ứng dụng

  • Hướng hàng

Ví dụ về lưu trữ theo hàng

  • Lưu theo từng bản ghi
  • Thêm theo từng giao dịch
  • Ví dụ: thêm khách hàng rất nhanh
Introduction to Data Engineering

Cơ sở dữ liệu MPP

Cơ sở dữ liệu xử lý song song quy mô lớn

Sơ đồ cơ sở dữ liệu MPP

 

  • Amazon Redshift
  • Azure SQL Data Warehouse
  • Google BigQuery
Introduction to Data Engineering

Ví dụ: Redshift

Tải từ tệp sang định dạng lưu trữ dạng cột

# Pandas .to_parquet() method
df.to_parquet("s3://path/to/bucket/customer.parquet")
# PySpark .write.parquet() method
df.write.parquet("s3://path/to/bucket/customer.parquet")
COPY customer
FROM 's3://path/to/bucket/customer.parquet'
FORMAT as parquet
...
Introduction to Data Engineering

Tải vào PostgreSQL

pandas.to_sql()

# Transformation on data
recommendations = transform_find_recommendatins(ratings_df)

# Load into PostgreSQL database
recommendations.to_sql("recommendations",
                       db_engine,
                       schema="store",
                       if_exists="replace")
Introduction to Data Engineering

Cùng luyện tập nào!

Introduction to Data Engineering

Preparing Video For Download...