# rkvarma4518/e-commerce-streaming-data-processing architecture

> Architecture diagram of the GitHub repository rkvarma4518/e-commerce-streaming-data-processing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rkvarma4518/e-commerce-streaming-data-processing
- Repository: https://github.com/rkvarma4518/e-commerce-streaming-data-processing

## Overview

This repository generates e-commerce activity events and processes them through a Databricks medallion pipeline into analytics tables. The principal workflow is event generation and Kafka publication, raw Bronze ingestion, Silver parsing and validation, then five Gold star-schema outputs. Gold tables are shown as independent Silver-derived outputs: the sampled fact implementation selects dimension-like keys but does not read or join the dimension tables. Relationships are limited to those shown in excerpts or the README.

Main entry points: [`pl_ecommerce_kafka_stream_ingestion/transformations/silver/silver_events.py`](https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/silver/silver_events.py) (Silver Events), [`pl_ecommerce_kafka_stream_ingestion/transformations/bronze/bronze_kafka.py`](https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/bronze/bronze_kafka.py) (Bronze Ingestion), [`ecommerce_producer.py`](https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/ecommerce_producer.py) (Event Producer), [`pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_customers.py`](https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_customers.py) (Customer Dimension)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source["Event Source"]
  node_producer["Event Producer"]
end

subgraph group_pipeline["Medallion Pipeline"]
  node_bronze[("Bronze Ingestion<br/>[bronze_kafka.py]")]
  node_silver[("Silver Events<br/>[silver_events.py]")]
end

subgraph group_analytics["Gold Analytics"]
  node_customers[("Customer Dimension<br/>[dim_customers.py]")]
  node_event_types[("Event Type Dimension<br/>[dim_event_types.py]")]
  node_products[("Product Dimension<br/>[dim_products.py]")]
  node_time[("Time Dimension<br/>[dim_time.py]")]
  node_fact[("Engagement Fact<br/>[fact_engagement.py]")]
end

node_kafka["Kafka Topic"]

node_producer -->|"publishes events"| node_kafka
node_kafka -->|"streams from"| node_bronze
node_bronze -->|"parses and validates"| node_silver
node_silver -->|"derives customers"| node_customers
node_silver -->|"derives event types"| node_event_types
node_silver -->|"derives products"| node_products
node_silver -->|"derives time"| node_time
node_silver -->|"builds fact rows"| node_fact

click node_producer "https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/ecommerce_producer.py"
click node_bronze "https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/bronze/bronze_kafka.py"
click node_silver "https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/silver/silver_events.py"
click node_customers "https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_customers.py"
click node_event_types "https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_event_types.py"
click node_products "https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_products.py"
click node_time "https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_time.py"
click node_fact "https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/gold/fact_engagement.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_producer toneBlue
class node_bronze,node_silver toneAmber
class node_customers,node_event_types,node_products,node_time,node_fact toneMint
class node_kafka toneIndigo
```

## Components

### Event Source

- [Event Producer](https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/ecommerce_producer.py): `ecommerce_producer.py`

### Medallion Pipeline

- [Bronze Ingestion](https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/bronze/bronze_kafka.py): `pl_ecommerce_kafka_stream_ingestion/transformations/bronze/bronze_kafka.py`
- [Silver Events](https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/silver/silver_events.py): `pl_ecommerce_kafka_stream_ingestion/transformations/silver/silver_events.py`

### Gold Analytics

- [Customer Dimension](https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_customers.py): `pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_customers.py`
- [Event Type Dimension](https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_event_types.py): `pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_event_types.py`
- [Product Dimension](https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_products.py): `pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_products.py`
- [Time Dimension](https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_time.py): `pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_time.py`
- [Engagement Fact](https://github.com/rkvarma4518/e-commerce-streaming-data-processing/blob/main/pl_ecommerce_kafka_stream_ingestion/transformations/gold/fact_engagement.py): `pl_ecommerce_kafka_stream_ingestion/transformations/gold/fact_engagement.py`

### Other components

- **Kafka Topic**

## Connections

- Event Producer → Kafka Topic: publishes events (evidence: `ecommerce_producer.py`)
- Kafka Topic → Bronze Ingestion: streams from (evidence: `pl_ecommerce_kafka_stream_ingestion/transformations/bronze/bronze_kafka.py`)
- Bronze Ingestion → Silver Events: parses and validates (evidence: `pl_ecommerce_kafka_stream_ingestion/transformations/silver/silver_events.py`)
- Silver Events → Customer Dimension: derives customers (evidence: `pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_customers.py`)
- Silver Events → Event Type Dimension: derives event types (evidence: `pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_event_types.py`)
- Silver Events → Product Dimension: derives products (evidence: `pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_products.py`)
- Silver Events → Time Dimension: derives time (evidence: `pl_ecommerce_kafka_stream_ingestion/transformations/gold/dim_time.py`)
- Silver Events → Engagement Fact: builds fact rows (evidence: `pl_ecommerce_kafka_stream_ingestion/transformations/gold/fact_engagement.py`)
