# chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction architecture

> Architecture diagram of the GitHub repository chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction
- Repository: https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction

## Overview

This repository implements a scheduled YouTube trending-data ETL pipeline. Its main workflow collects regional video and category data, lands raw inputs in Bronze, transforms statistics and reference data into Silver, validates Silver data, and builds Gold analytics for Athena and QuickSight. Historical Kaggle data is also documented as a Bronze input. The graph preserves the three documented analytics outputs and the optional category-reference join. Some orchestration, ingestion, and quality-gate implementation files were not sampled; their links rely on README statements rather than inspected source.

Main entry points: [`step_functions/pipeline_orchestation.json`](https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/step_functions/pipeline_orchestation.json) (Step Functions), [`glue_jobs/silver_to_gold_analytics.py`](https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/glue_jobs/silver_to_gold_analytics.py) (Analytics Aggregation), [`lambdas/youtube_api_integstion/lambda_function.py`](https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/lambdas/youtube_api_integstion/lambda_function.py) (Video Ingestion), [`glue_jobs/bronze_to_silver_statistics.py`](https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/glue_jobs/bronze_to_silver_statistics.py) (Statistics Cleanup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Ingestion"]
  node_schedule(("EventBridge Schedule"))
  node_orchestrator["Step Functions"]
  node_api_ingest["Video Ingestion<br/>[lambda_function.py]"]
  node_historical_data["Historical Data"]
end

subgraph group_storage["Medallion Storage"]
  node_bronze[("Bronze S3")]
  node_silver[("Silver S3")]
  node_gold[("Gold S3")]
end

subgraph group_transform["Transformations"]
  node_bronze_stats["Statistics Cleanup"]
  node_reference_transform["Reference Transform<br/>[lambda_function.py]"]
end

subgraph group_quality["Quality Gate"]
  node_quality_check["Data Quality<br/>[dq_lambda.py]"]
  node_sns["SNS Alerts"]
end

subgraph group_analytics["Analytics"]
  node_gold_job["Analytics Aggregation"]
  node_athena["Athena"]
  node_quicksight["QuickSight"]
end

node_youtube(("YouTube API"))
node_kaggle(("Kaggle Dataset"))

node_schedule -->|"starts"| node_orchestrator
node_orchestrator -->|"coordinates"| node_api_ingest
node_youtube -->|"provides data"| node_api_ingest
node_api_ingest -->|"writes raw data"| node_bronze
node_kaggle -->|"supplies data"| node_historical_data
node_historical_data -->|"uploaded to"| node_bronze
node_orchestrator -->|"coordinates"| node_bronze_stats
node_orchestrator -->|"coordinates"| node_reference_transform
node_bronze -->|"read catalog data"| node_bronze_stats
node_bronze_stats -->|"writes Parquet"| node_silver
node_bronze -->|"triggers and supplies JSON"| node_reference_transform
node_reference_transform -->|"writes Parquet"| node_silver
node_orchestrator -->|"runs quality gate"| node_quality_check
node_silver -->|"validates data"| node_quality_check
node_quality_check -->|"alerts on failure"| node_sns
node_orchestrator -->|"runs after validation"| node_gold_job
node_silver -->|"reads statistics"| node_gold_job
node_silver -.->|"optionally joins reference"| node_gold_job
node_gold_job -->|"writes analytics tables"| node_gold
node_gold -->|"queried by"| node_athena
node_gold -->|"analyzed in"| node_quicksight

click node_orchestrator "https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/step_functions/pipeline_orchestation.json"
click node_api_ingest "https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/lambdas/youtube_api_integstion/lambda_function.py"
click node_historical_data "https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/tree/main/data"
click node_bronze_stats "https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/glue_jobs/bronze_to_silver_statistics.py"
click node_reference_transform "https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/lambdas/json_to_parquet/lambda_function.py"
click node_quality_check "https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/data_quality/dq_lambda.py"
click node_gold_job "https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/glue_jobs/silver_to_gold_analytics.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_schedule,node_orchestrator,node_api_ingest,node_historical_data toneBlue
class node_bronze,node_silver,node_gold toneAmber
class node_bronze_stats,node_reference_transform,node_youtube toneMint
class node_quality_check,node_sns toneRose
class node_gold_job,node_athena,node_quicksight,node_kaggle toneIndigo
```

## Components

### Ingestion

- **EventBridge Schedule**
- [Step Functions](https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/step_functions/pipeline_orchestation.json): `step_functions/pipeline_orchestation.json`
- [Video Ingestion](https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/lambdas/youtube_api_integstion/lambda_function.py): `lambdas/youtube_api_integstion/lambda_function.py`
- [Historical Data](https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/tree/main/data): `data`

### Medallion Storage

- **Bronze S3**
- **Silver S3**
- **Gold S3**

### Transformations

- [Statistics Cleanup](https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/glue_jobs/bronze_to_silver_statistics.py): `glue_jobs/bronze_to_silver_statistics.py`
- [Reference Transform](https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/lambdas/json_to_parquet/lambda_function.py): `lambdas/json_to_parquet/lambda_function.py`

### Quality Gate

- [Data Quality](https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/data_quality/dq_lambda.py): `data_quality/dq_lambda.py`
- **SNS Alerts**

### Analytics

- [Analytics Aggregation](https://github.com/chandusrinivas0506/youtube-data-piepline-aws-s3-lambda-glue-athena-stepfunction/blob/main/glue_jobs/silver_to_gold_analytics.py): `glue_jobs/silver_to_gold_analytics.py`
- **Athena**
- **QuickSight**

### Other components

- **YouTube API**
- **Kaggle Dataset**

## Connections

- EventBridge Schedule → Step Functions: starts (evidence: `README.md`)
- Step Functions → Video Ingestion: coordinates (evidence: `README.md`)
- YouTube API → Video Ingestion: provides data (evidence: `README.md`)
- Video Ingestion → Bronze S3: writes raw data (evidence: `README.md`)
- Kaggle Dataset → Historical Data: supplies data (evidence: `README.md`)
- Historical Data → Bronze S3: uploaded to (evidence: `README.md`)
- Step Functions → Statistics Cleanup: coordinates (evidence: `README.md`)
- Step Functions → Reference Transform: coordinates (evidence: `README.md`)
- Bronze S3 → Statistics Cleanup: read catalog data (evidence: `glue_jobs/bronze_to_silver_statistics.py`)
- Statistics Cleanup → Silver S3: writes Parquet (evidence: `glue_jobs/bronze_to_silver_statistics.py`)
- Bronze S3 → Reference Transform: triggers and supplies JSON (evidence: `lambdas/json_to_parquet/lambda_function.py`)
- Reference Transform → Silver S3: writes Parquet (evidence: `lambdas/json_to_parquet/lambda_function.py`)
- Step Functions → Data Quality: runs quality gate (evidence: `README.md`)
- Silver S3 → Data Quality: validates data (evidence: `README.md`)
- Data Quality → SNS Alerts: alerts on failure (evidence: `README.md`)
- Step Functions → Analytics Aggregation: runs after validation (evidence: `README.md`)
- Silver S3 → Analytics Aggregation: reads statistics (evidence: `glue_jobs/silver_to_gold_analytics.py`)
- Silver S3 → Analytics Aggregation: optionally joins reference (evidence: `glue_jobs/silver_to_gold_analytics.py`)
- Analytics Aggregation → Gold S3: writes analytics tables (evidence: `glue_jobs/silver_to_gold_analytics.py`)
- Gold S3 → Athena: queried by (evidence: `README.md`)
- Gold S3 → QuickSight: analyzed in (evidence: `README.md`)
