# sgallol2/bigdata-natalidad architecture

> Architecture diagram of the GitHub repository sgallol2/bigdata-natalidad, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sgallol2/bigdata-natalidad
- Repository: https://github.com/sgallol2/bigdata-natalidad

## Overview

El producto es un pipeline analítico de natalidad en Colombia sobre AWS: incorpora microdatos del DANE, dimensiones de RDS y series del Banco Mundial; prepara y cataloga los datos para análisis y visualización. La ruta principal va de fuentes diversas a S3 raw, Glue transforma a trusted, y SQL/PySpark produce análisis y resultados que consume el dashboard. Las relaciones entre etapas se basan en la arquitectura y el orden documentados en el README; los detalles de varios módulos de ingesta, catalogación y SQL no fueron muestreados.

Main entry points: [`03-ingesta`](https://github.com/sgallol2/bigdata-natalidad/tree/main/03-ingesta) (Ingesta multi-fuente), [`03-ingesta/ingesta_api.py`](https://github.com/sgallol2/bigdata-natalidad/blob/main/03-ingesta/ingesta_api.py) (Ingesta World Bank), [`04-glue-spark/glue_raw_a_trusted_nacimientos.py`](https://github.com/sgallol2/bigdata-natalidad/blob/main/04-glue-spark/glue_raw_a_trusted_nacimientos.py) (Preparación nacimientos), [`04-glue-spark/glue_raw_a_trusted_api.py`](https://github.com/sgallol2/bigdata-natalidad/blob/main/04-glue-spark/glue_raw_a_trusted_api.py) (Preparación World Bank)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sources["Fuentes e ingesta"]
  node_dane["Microdatos DANE"]
  node_rds[("Dimensiones RDS<br/>[01_esquema.sql]")]
  node_worldbank{{"API Data360"}}
  node_ingest["Ingesta multi-fuente"]
  node_wb_ingest["Ingesta World Bank<br/>[ingesta_api.py]"]
end

subgraph group_lake["Data lake y preparación"]
  node_raw[("S3 raw")]
  node_births_prep["Preparación nacimientos"]
  node_wb_prep["Preparación World Bank"]
  node_dim_prep["Preparación dimensiones"]
  node_trusted[("S3 trusted")]
end

subgraph group_analytics["Catálogo y análisis"]
  node_catalog["Catálogo de datos"]
  node_sql["Consultas SQL"]
  node_pyspark["Análisis PySpark"]
  node_refined[("S3 refined")]
end

subgraph group_serving["Servicio y visualización"]
  node_lambda["API de métricas<br/>[lambda_function.py]"]
  node_gateway{{"API Gateway"}}
  node_dashboard["Dashboard Streamlit<br/>[app.py]"]
end

node_user(("Analista"))

node_dane -->|"carga archivos"| node_raw
node_rds -->|"extrae dimensiones"| node_ingest
node_ingest -->|"carga datos"| node_raw
node_worldbank -->|"solicita páginas"| node_wb_ingest
node_wb_ingest -->|"escribe JSON"| node_raw
node_raw -->|"lee CSV"| node_births_prep
node_raw -->|"lee JSON"| node_wb_prep
node_raw -->|"lee TSV"| node_dim_prep
node_births_prep -->|"escribe Parquet"| node_trusted
node_wb_prep -->|"escribe Parquet"| node_trusted
node_dim_prep -->|"escribe Parquet"| node_trusted
node_trusted -->|"cataloga tablas"| node_catalog
node_catalog -->|"habilita consultas"| node_sql
node_trusted -->|"lee Parquet"| node_pyspark
node_pyspark -->|"escribe resultados"| node_refined
node_sql -->|"responde preguntas"| node_user
node_gateway -->|"envía solicitudes"| node_lambda
node_lambda -->|"lee métricas"| node_refined
node_dashboard -->|"consulta métricas"| node_gateway
node_user -->|"explora gráficos"| node_dashboard

click node_rds "https://github.com/sgallol2/bigdata-natalidad/blob/main/02-fuentes/01_esquema.sql"
click node_ingest "https://github.com/sgallol2/bigdata-natalidad/tree/main/03-ingesta"
click node_wb_ingest "https://github.com/sgallol2/bigdata-natalidad/blob/main/03-ingesta/ingesta_api.py"
click node_births_prep "https://github.com/sgallol2/bigdata-natalidad/blob/main/04-glue-spark/glue_raw_a_trusted_nacimientos.py"
click node_wb_prep "https://github.com/sgallol2/bigdata-natalidad/blob/main/04-glue-spark/glue_raw_a_trusted_api.py"
click node_dim_prep "https://github.com/sgallol2/bigdata-natalidad/blob/main/04-glue-spark/glue_raw_a_trusted_rds.py"
click node_catalog "https://github.com/sgallol2/bigdata-natalidad/tree/main/05-catalogacion"
click node_sql "https://github.com/sgallol2/bigdata-natalidad/tree/main/06-consultas-sql"
click node_pyspark "https://github.com/sgallol2/bigdata-natalidad/blob/main/07-pyspark/analisis_descriptivo_pyspark.py"
click node_lambda "https://github.com/sgallol2/bigdata-natalidad/blob/main/08-visualizacion-api/lambda_function.py"
click node_dashboard "https://github.com/sgallol2/bigdata-natalidad/blob/main/08-visualizacion-api/app.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_dane,node_rds,node_worldbank,node_ingest,node_wb_ingest toneBlue
class node_raw,node_births_prep,node_wb_prep,node_dim_prep,node_trusted toneAmber
class node_catalog,node_sql,node_pyspark,node_refined toneMint
class node_lambda,node_gateway,node_dashboard toneRose
class node_user toneIndigo
```

## Components

### Fuentes e ingesta

- **Microdatos DANE**
- [Dimensiones RDS](https://github.com/sgallol2/bigdata-natalidad/blob/main/02-fuentes/01_esquema.sql): `02-fuentes/01_esquema.sql`
- **API Data360**
- [Ingesta multi-fuente](https://github.com/sgallol2/bigdata-natalidad/tree/main/03-ingesta): `03-ingesta`
- [Ingesta World Bank](https://github.com/sgallol2/bigdata-natalidad/blob/main/03-ingesta/ingesta_api.py): `03-ingesta/ingesta_api.py`

### Data lake y preparación

- **S3 raw**
- [Preparación nacimientos](https://github.com/sgallol2/bigdata-natalidad/blob/main/04-glue-spark/glue_raw_a_trusted_nacimientos.py): `04-glue-spark/glue_raw_a_trusted_nacimientos.py`
- [Preparación World Bank](https://github.com/sgallol2/bigdata-natalidad/blob/main/04-glue-spark/glue_raw_a_trusted_api.py): `04-glue-spark/glue_raw_a_trusted_api.py`
- [Preparación dimensiones](https://github.com/sgallol2/bigdata-natalidad/blob/main/04-glue-spark/glue_raw_a_trusted_rds.py): `04-glue-spark/glue_raw_a_trusted_rds.py`
- **S3 trusted**

### Catálogo y análisis

- [Catálogo de datos](https://github.com/sgallol2/bigdata-natalidad/tree/main/05-catalogacion): `05-catalogacion`
- [Consultas SQL](https://github.com/sgallol2/bigdata-natalidad/tree/main/06-consultas-sql): `06-consultas-sql`
- [Análisis PySpark](https://github.com/sgallol2/bigdata-natalidad/blob/main/07-pyspark/analisis_descriptivo_pyspark.py): `07-pyspark/analisis_descriptivo_pyspark.py`
- **S3 refined**

### Servicio y visualización

- [API de métricas](https://github.com/sgallol2/bigdata-natalidad/blob/main/08-visualizacion-api/lambda_function.py): `08-visualizacion-api/lambda_function.py`
- **API Gateway**
- [Dashboard Streamlit](https://github.com/sgallol2/bigdata-natalidad/blob/main/08-visualizacion-api/app.py): `08-visualizacion-api/app.py`

### Other components

- **Analista**

## Connections

- Microdatos DANE → S3 raw: carga archivos (evidence: `README.md`)
- Dimensiones RDS → Ingesta multi-fuente: extrae dimensiones (evidence: `README.md`)
- Ingesta multi-fuente → S3 raw: carga datos (evidence: `README.md`)
- API Data360 → Ingesta World Bank: solicita páginas (evidence: `03-ingesta/ingesta_api.py`)
- Ingesta World Bank → S3 raw: escribe JSON (evidence: `03-ingesta/ingesta_api.py`)
- S3 raw → Preparación nacimientos: lee CSV (evidence: `04-glue-spark/glue_raw_a_trusted_nacimientos.py`)
- S3 raw → Preparación World Bank: lee JSON (evidence: `04-glue-spark/glue_raw_a_trusted_api.py`)
- S3 raw → Preparación dimensiones: lee TSV (evidence: `04-glue-spark/glue_raw_a_trusted_rds.py`)
- Preparación nacimientos → S3 trusted: escribe Parquet (evidence: `04-glue-spark/glue_raw_a_trusted_nacimientos.py`)
- Preparación World Bank → S3 trusted: escribe Parquet (evidence: `04-glue-spark/glue_raw_a_trusted_api.py`)
- Preparación dimensiones → S3 trusted: escribe Parquet (evidence: `04-glue-spark/glue_raw_a_trusted_rds.py`)
- S3 trusted → Catálogo de datos: cataloga tablas (evidence: `README.md`)
- Catálogo de datos → Consultas SQL: habilita consultas (evidence: `README.md`)
- S3 trusted → Análisis PySpark: lee Parquet (evidence: `07-pyspark/analisis_descriptivo_pyspark.py`)
- Análisis PySpark → S3 refined: escribe resultados (evidence: `07-pyspark/analisis_descriptivo_pyspark.py`)
- Consultas SQL → Analista: responde preguntas (evidence: `README.md`)
- API Gateway → API de métricas: envía solicitudes (evidence: `README.md`)
- API de métricas → S3 refined: lee métricas (evidence: `08-visualizacion-api/lambda_function.py`)
- Dashboard Streamlit → API Gateway: consulta métricas (evidence: `08-visualizacion-api/app.py`)
- Analista → Dashboard Streamlit: explora gráficos (evidence: `README.md`)
