# basavaprabhuh/datashield-segmented-secure-analytics architecture

> Architecture diagram of the GitHub repository basavaprabhuh/datashield-segmented-secure-analytics, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/basavaprabhuh/datashield-segmented-secure-analytics
- Repository: https://github.com/basavaprabhuh/datashield-segmented-secure-analytics

## Overview

DataShield is a segmented analytics pipeline: users submit data through an API and Collector tier; scheduled processing transfers it to an Analyzer, which stores processed data in S3 and backs up raw data to encrypted Archive storage. An S3 event invokes Lambda to record metadata in private RDS, while a separate load-balanced Service tier retrieves that metadata. The README documents the broader AWS topology and automation; source excerpts confirm the Collector’s file handling and the Lambda and Service database access, but not every infrastructure connection.

Main entry points: [`analyzer/process.sh`](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/analyzer/process.sh) (Analyzer processing), [`service/app.py`](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/service/app.py) (Metadata Service), [`collector/forward.sh`](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/collector/forward.sh) (Collector forwarding), [`aws-config/api-gateway.md`](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/aws-config/api-gateway.md) (API Gateway)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Ingestion"]
  node_api["API Gateway<br/>[api-gateway.md]"]
  node_collector_alb["Collector ALB<br/>[load-balancers.md]"]
  node_collector["Collector endpoint<br/>[ingest_server.py]"]
  node_incoming[("Incoming files<br/>[ingest_server.py]")]
  node_collector_cron["Collector forwarding<br/>[forward.sh]"]
end

subgraph group_processing["Processing and Archive"]
  node_analyzer["Analyzer processing<br/>[process.sh]"]
  node_archive[("Encrypted Archive<br/>[luks-setup.md]")]
end

subgraph group_metadata["Metadata Pipeline"]
  node_s3[("Processed-data S3<br/>[s3.md]")]
  node_lambda["Metadata Lambda<br/>[lambda_function.py]"]
  node_rds[("Private RDS<br/>[schema.sql]")]
end

subgraph group_serving["Service Tier"]
  node_project_alb["Project ALB<br/>[load-balancers.md]"]
  node_service["Metadata Service<br/>[app.py]"]
  node_autoscaling["Service Auto Scaling<br/>[auto-scaling.md]"]
end

node_user(("Data submitter"))

node_user -->|"submits data"| node_api
node_api -->|"routes ingestion"| node_collector_alb
node_collector_alb -->|"forwards request"| node_collector
node_collector -->|"writes files"| node_incoming
node_collector_cron -->|"forwards files"| node_incoming
node_collector_cron -->|"SCP transfer"| node_analyzer
node_analyzer -->|"uploads output"| node_s3
node_analyzer -->|"backs up raw data"| node_archive
node_s3 -->|"ObjectCreated invokes"| node_lambda
node_lambda -->|"inserts metadata"| node_rds
node_project_alb -->|"routes requests"| node_service
node_service -->|"queries metadata"| node_rds
node_autoscaling -->|"maintains instances"| node_service

click node_api "https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/aws-config/api-gateway.md"
click node_collector_alb "https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/aws-config/load-balancers.md"
click node_collector "https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/collector/ingest_server.py"
click node_incoming "https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/collector/ingest_server.py"
click node_collector_cron "https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/collector/forward.sh"
click node_analyzer "https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/analyzer/process.sh"
click node_s3 "https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/aws-config/s3.md"
click node_archive "https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/archive/luks-setup.md"
click node_lambda "https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/lambda/lambda_function.py"
click node_rds "https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/database/schema.sql"
click node_project_alb "https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/aws-config/load-balancers.md"
click node_service "https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/service/app.py"
click node_autoscaling "https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/aws-config/auto-scaling.md"

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_api,node_collector_alb,node_collector,node_incoming,node_collector_cron toneBlue
class node_analyzer,node_archive toneAmber
class node_s3,node_lambda,node_rds toneMint
class node_project_alb,node_service,node_autoscaling toneRose
class node_user toneIndigo
```

## Components

### Ingestion

- [API Gateway](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/aws-config/api-gateway.md): `aws-config/api-gateway.md`
- [Collector ALB](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/aws-config/load-balancers.md): `aws-config/load-balancers.md`
- [Collector endpoint](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/collector/ingest_server.py): `collector/ingest_server.py`
- [Incoming files](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/collector/ingest_server.py): `collector/ingest_server.py`
- [Collector forwarding](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/collector/forward.sh): `collector/forward.sh`

### Processing and Archive

- [Analyzer processing](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/analyzer/process.sh): `analyzer/process.sh`
- [Encrypted Archive](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/archive/luks-setup.md): `archive/luks-setup.md`

### Metadata Pipeline

- [Processed-data S3](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/aws-config/s3.md): `aws-config/s3.md`
- [Metadata Lambda](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/lambda/lambda_function.py): `lambda/lambda_function.py`
- [Private RDS](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/database/schema.sql): `database/schema.sql`

### Service Tier

- [Project ALB](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/aws-config/load-balancers.md): `aws-config/load-balancers.md`
- [Metadata Service](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/service/app.py): `service/app.py`
- [Service Auto Scaling](https://github.com/basavaprabhuh/datashield-segmented-secure-analytics/blob/main/aws-config/auto-scaling.md): `aws-config/auto-scaling.md`

### Other components

- **Data submitter**

## Connections

- Data submitter → API Gateway: submits data (evidence: `README.md`)
- API Gateway → Collector ALB: routes ingestion (evidence: `README.md`)
- Collector ALB → Collector endpoint: forwards request (evidence: `README.md`)
- Collector endpoint → Incoming files: writes files (evidence: `collector/ingest_server.py`)
- Collector forwarding → Incoming files: forwards files (evidence: `README.md`)
- Collector forwarding → Analyzer processing: SCP transfer (evidence: `README.md`)
- Analyzer processing → Processed-data S3: uploads output (evidence: `README.md`)
- Analyzer processing → Encrypted Archive: backs up raw data (evidence: `README.md`)
- Processed-data S3 → Metadata Lambda: ObjectCreated invokes (evidence: `README.md`)
- Metadata Lambda → Private RDS: inserts metadata (evidence: `lambda/lambda_function.py`)
- Project ALB → Metadata Service: routes requests (evidence: `README.md`)
- Metadata Service → Private RDS: queries metadata (evidence: `service/app.py`)
- Service Auto Scaling → Metadata Service: maintains instances (evidence: `README.md`)
