# ashwinmv14/efficient_byte_storage architecture

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

- Interactive diagram: https://gitdiagram.com/ashwinmv14/efficient_byte_storage
- Repository: https://github.com/ashwinmv14/efficient_byte_storage

## Overview

This Go application demonstrates a typed in-memory key-value store and its compact binary persistence format. The principal workflow branches on whether store.bin exists: a first run builds sample entries, serializes them, and reports size and timing; later runs deserialize the file and report reload time and heap use. The graph distinguishes the CLI orchestrator, store, and persistence/reporting layer. Relationships are based on the shown source and README; the filesystem is represented as an external resource.

Main entry points: [`main.go`](https://github.com/ashwinmv14/efficient_byte_storage/blob/main/main.go) (Run orchestrator), [`report.go`](https://github.com/ashwinmv14/efficient_byte_storage/blob/main/report.go) (Measurement), [`serialize.go`](https://github.com/ashwinmv14/efficient_byte_storage/blob/main/serialize.go) (Binary codec), [`store.go`](https://github.com/ashwinmv14/efficient_byte_storage/blob/main/store.go) (In-memory store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflow"]
  node_cli["Run orchestrator<br/>[main.go]"]
  node_builder["Sample builder<br/>[main.go]"]
end

subgraph group_store["Typed store"]
  node_store[("In-memory store<br/>[store.go]")]
end

subgraph group_persistence["Persistence and reporting"]
  node_serializer["Binary codec<br/>[serialize.go]"]
  node_measurement["Measurement<br/>[report.go]"]
  node_reporting["Report output<br/>[report.go]"]
end

node_user(("Operator"))
node_disk[("Local file")]

node_user -->|"runs"| node_cli
node_cli -->|"checks existence"| node_disk
node_cli -->|"builds entries"| node_builder
node_builder -->|"populates"| node_store
node_cli -->|"measures write"| node_measurement
node_cli -->|"measures reload"| node_measurement
node_cli -->|"prints reports"| node_reporting
node_measurement -->|"serializes or loads"| node_serializer
node_measurement -->|"counts entries"| node_store
node_serializer -->|"reads or populates"| node_store
node_serializer -->|"writes or reads"| node_disk

click node_cli "https://github.com/ashwinmv14/efficient_byte_storage/blob/main/main.go"
click node_builder "https://github.com/ashwinmv14/efficient_byte_storage/blob/main/main.go"
click node_store "https://github.com/ashwinmv14/efficient_byte_storage/blob/main/store.go"
click node_serializer "https://github.com/ashwinmv14/efficient_byte_storage/blob/main/serialize.go"
click node_measurement "https://github.com/ashwinmv14/efficient_byte_storage/blob/main/report.go"
click node_reporting "https://github.com/ashwinmv14/efficient_byte_storage/blob/main/report.go"

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_cli,node_builder toneBlue
class node_store,node_disk toneAmber
class node_serializer,node_measurement,node_reporting toneMint
class node_user toneIndigo
```

## Components

### CLI workflow

- [Run orchestrator](https://github.com/ashwinmv14/efficient_byte_storage/blob/main/main.go): `main.go`
- [Sample builder](https://github.com/ashwinmv14/efficient_byte_storage/blob/main/main.go): `main.go`

### Typed store

- [In-memory store](https://github.com/ashwinmv14/efficient_byte_storage/blob/main/store.go): `store.go`

### Persistence and reporting

- [Binary codec](https://github.com/ashwinmv14/efficient_byte_storage/blob/main/serialize.go): `serialize.go`
- [Measurement](https://github.com/ashwinmv14/efficient_byte_storage/blob/main/report.go): `report.go`
- [Report output](https://github.com/ashwinmv14/efficient_byte_storage/blob/main/report.go): `report.go`

### Other components

- **Operator**
- **Local file**

## Connections

- Operator → Run orchestrator: runs (evidence: `README.md`)
- Run orchestrator → Local file: checks existence (evidence: `main.go`)
- Run orchestrator → Sample builder: builds entries (evidence: `main.go`)
- Sample builder → In-memory store: populates (evidence: `main.go`)
- Run orchestrator → Measurement: measures write (evidence: `main.go`)
- Run orchestrator → Measurement: measures reload (evidence: `main.go`)
- Run orchestrator → Report output: prints reports (evidence: `main.go`)
- Measurement → Binary codec: serializes or loads (evidence: `report.go`)
- Measurement → In-memory store: counts entries (evidence: `report.go`)
- Binary codec → In-memory store: reads or populates (evidence: `serialize.go`)
- Binary codec → Local file: writes or reads (evidence: `serialize.go`)
