Chargement

Introduction au data engineering

Vincent Vankrunkelsven

Data Engineer @ DataCamp

Bases pour analytique ou applications

Analytics

Icône représentant l’analytique

  • Requêtes d’agrégation
  • OLAP (traitement analytique en ligne)

Applications

Icône représentant des applications

  • Beaucoup de transactions
  • OLTP (traitement des transactions en ligne)
Introduction au data engineering

Orienté colonnes vs lignes

Analytics

  • Orienté colonnes

Exemple de stockage orienté colonnes

  • Requêtes sur un sous-ensemble de colonnes
  • Parallélisation

Applications

  • Orienté lignes

Exemple de stockage orienté lignes

  • Stocké par enregistrement
  • Ajouté par transaction
  • P. ex. ajout d’un client rapide
Introduction au data engineering

Bases MPP

Bases MPP (Massively Parallel Processing)

Schéma d’une base MPP

 

  • Amazon Redshift
  • Azure SQL Data Warehouse
  • Google BigQuery
Introduction au data engineering

Exemple : Redshift

Charger depuis un fichier vers un format colonne

# Méthode Pandas .to_parquet()
df.to_parquet("./s3://path/to/bucket/customer.parquet")
# Méthode PySpark .write.parquet()
df.write.parquet("./s3://path/to/bucket/customer.parquet")
COPY customer
FROM 's3://path/to/bucket/customer.parquet'
FORMAT as parquet
...
Introduction au data engineering

Charger vers PostgreSQL

pandas.to_sql()

# Transformation des données
recommendations = transform_find_recommendatins(ratings_df)

# Chargement dans PostgreSQL
recommendations.to_sql("recommendations",
                       db_engine,
                       schema="store",
                       if_exists="replace")
Introduction au data engineering

Passons à la pratique !

Introduction au data engineering

Preparing Video For Download...