# xogxsss/tpi_bd architecture

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

- Interactive diagram: https://gitdiagram.com/xogxsss/tpi_bd
- Repository: https://github.com/xogxsss/tpi_bd

## Overview

FoodStore is a PostgreSQL database engineering project, not an application server. Its main workflow is to create the relational schema, load synthetic data, then inspect and tune queries; separate SQL scripts add reporting views, integrity triggers, and security roles. Reports document performance and concurrency experiments. The README describes the execution order and capabilities, but no source excerpts were supplied, so relationships below are limited to those documented there.

Main entry points: [`schema.sql`](https://github.com/xogxsss/tpi_bd/blob/main/schema.sql) (Relational schema), [`data.sql`](https://github.com/xogxsss/tpi_bd/blob/main/data.sql) (Synthetic data load), [`queries.sql`](https://github.com/xogxsss/tpi_bd/blob/main/queries.sql) (Query catalog), [`indices.sql`](https://github.com/xogxsss/tpi_bd/blob/main/indices.sql) (Index experiments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundation["Database foundation"]
  node_schema["Relational schema<br/>[schema.sql]"]
  node_data["Synthetic data load<br/>[data.sql]"]
end

subgraph group_analysis["Query analysis"]
  node_queries["Query catalog<br/>[queries.sql]"]
  node_indices["Index experiments<br/>[indices.sql]"]
  node_measurements["Performance report"]
end

subgraph group_database_features["Database features"]
  node_views["Reporting views<br/>[views.sql]"]
  node_integrity["Integrity triggers"]
end

subgraph group_operations["Security and operations"]
  node_roles["Security roles<br/>[roles.sql]"]
  node_concurrency["Concurrency report"]
  node_security_protocol["Safe-work protocol"]
end

node_operator(("Database operator"))
node_postgres[("PostgreSQL database")]

node_operator -->|"runs first"| node_schema
node_schema -->|"creates schema"| node_postgres
node_operator -->|"runs next"| node_data
node_data -->|"loads rows"| node_postgres
node_operator -->|"executes queries"| node_queries
node_queries -->|"queries and explains"| node_postgres
node_operator -->|"runs manually"| node_indices
node_indices -->|"experiments on indexes"| node_postgres
node_views -->|"defines views"| node_postgres
node_integrity -->|"adds triggers"| node_postgres
node_roles -->|"configures roles"| node_postgres
node_measurements -->|"reports measurements"| node_postgres
node_concurrency -->|"documents experiments"| node_postgres
node_operator -->|"follows guidance"| node_security_protocol

click node_schema "https://github.com/xogxsss/tpi_bd/blob/main/schema.sql"
click node_data "https://github.com/xogxsss/tpi_bd/blob/main/data.sql"
click node_queries "https://github.com/xogxsss/tpi_bd/blob/main/queries.sql"
click node_indices "https://github.com/xogxsss/tpi_bd/blob/main/indices.sql"
click node_measurements "https://github.com/xogxsss/tpi_bd/blob/main/informe_mediciones.md"
click node_views "https://github.com/xogxsss/tpi_bd/blob/main/views.sql"
click node_integrity "https://github.com/xogxsss/tpi_bd/blob/main/restricciones_integridad.sql"
click node_roles "https://github.com/xogxsss/tpi_bd/blob/main/food_store_tp_u5/sql/roles.sql"
click node_concurrency "https://github.com/xogxsss/tpi_bd/blob/main/informe_concurrencia.md"
click node_security_protocol "https://github.com/xogxsss/tpi_bd/blob/main/protocolo_seguridad.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_schema,node_data toneBlue
class node_queries,node_indices,node_measurements,node_operator,node_postgres toneAmber
class node_views,node_integrity toneMint
class node_roles,node_concurrency,node_security_protocol toneRose
```

## Components

### Database foundation

- [Relational schema](https://github.com/xogxsss/tpi_bd/blob/main/schema.sql): `schema.sql`
- [Synthetic data load](https://github.com/xogxsss/tpi_bd/blob/main/data.sql): `data.sql`

### Query analysis

- [Query catalog](https://github.com/xogxsss/tpi_bd/blob/main/queries.sql): `queries.sql`
- [Index experiments](https://github.com/xogxsss/tpi_bd/blob/main/indices.sql): `indices.sql`
- [Performance report](https://github.com/xogxsss/tpi_bd/blob/main/informe_mediciones.md): `informe_mediciones.md`

### Database features

- [Reporting views](https://github.com/xogxsss/tpi_bd/blob/main/views.sql): `views.sql`
- [Integrity triggers](https://github.com/xogxsss/tpi_bd/blob/main/restricciones_integridad.sql): `restricciones_integridad.sql`

### Security and operations

- [Security roles](https://github.com/xogxsss/tpi_bd/blob/main/food_store_tp_u5/sql/roles.sql): `food_store_tp_u5/sql/roles.sql`
- [Concurrency report](https://github.com/xogxsss/tpi_bd/blob/main/informe_concurrencia.md): `informe_concurrencia.md`
- [Safe-work protocol](https://github.com/xogxsss/tpi_bd/blob/main/protocolo_seguridad.md): `protocolo_seguridad.md`

### Other components

- **Database operator**
- **PostgreSQL database**

## Connections

- Database operator → Relational schema: runs first (evidence: `README.md`)
- Relational schema → PostgreSQL database: creates schema (evidence: `README.md`)
- Database operator → Synthetic data load: runs next (evidence: `README.md`)
- Synthetic data load → PostgreSQL database: loads rows (evidence: `README.md`)
- Database operator → Query catalog: executes queries (evidence: `README.md`)
- Query catalog → PostgreSQL database: queries and explains (evidence: `README.md`)
- Database operator → Index experiments: runs manually (evidence: `README.md`)
- Index experiments → PostgreSQL database: experiments on indexes (evidence: `README.md`)
- Reporting views → PostgreSQL database: defines views (evidence: `README.md`)
- Integrity triggers → PostgreSQL database: adds triggers (evidence: `README.md`)
- Security roles → PostgreSQL database: configures roles (evidence: `README.md`)
- Performance report → PostgreSQL database: reports measurements (evidence: `README.md`)
- Concurrency report → PostgreSQL database: documents experiments (evidence: `README.md`)
- Database operator → Safe-work protocol: follows guidance (evidence: `README.md`)
