Blob Storage Architecture
Comprehensive Azure Blob Storage design and file management architecture for the Grade My Investments platform.
flowchart LR
RE[Report Engine<br/>Linux VM]:::svc
DL[Download Builder<br/>Linux VM]:::svc
AF[Azure Functions<br/>API Layer]:::svc
subgraph CONTAINERS[Azure Blob Storage Containers]
C1[(reports<br/>Hot - 1 yr)]:::data
C2[(gmi-downloads<br/>Hot - purge managed)]:::data
C3[(user-uploads<br/>Hot - indefinite)]:::data
C4[(system-backups<br/>Cool - 7 yr)]:::data
end
SAS{{SAS Token<br/>time-limited}}:::sec
CLIENT[User Browser<br/>MAUI App]:::app
RE -->|upload xlsx - json| C1
DL -->|upload ZIP| C2
CLIENT -->|upload file| AF
AF -->|stream to| C3
AF -->|generate| SAS
SAS -->|direct download| CLIENT
C1 -->|lifecycle policy| C4
classDef app fill:#1f2630,stroke:#C0894E,color:#F3EFE8;
classDef svc fill:#241c14,stroke:#E2B583,color:#F3EFE8;
classDef data fill:#22201a,stroke:#C0894E,color:#EBD3AE;
classDef ext fill:#1b1f27,stroke:#5A616B,color:#C4C0B8;
classDef sec fill:#1d2733,stroke:#5cc8e0,color:#eafaff;Storage Overview
The Grade My Investments Blob Storage Architecture provides secure, scalable, and organized file storage for all generated reports, user uploads, and system assets. The architecture supports multiple storage tiers, automated lifecycle management, and seamless integration with the report generation pipeline.
Files are organized using a hierarchical container and folder structure that mirrors user account organization while maintaining security isolation and efficient access patterns.
Architecture Decisions
AI-Recommended Cost Optimization
During the Grade My Investments platform development, Claude AI recommended using Azure Blob Storage over database storage for report files - a decision that resulted in significant cost savings:
Original Design (Database Storage)
- Store report files as BLOB data in Azure SQL Database
- Simple implementation with direct SQL queries
- Unified data access through Entity Framework
- High storage costs per GB
Claude's Recommended Design (Blob Storage)
- Store files in Azure Blob Storage containers
- Store file metadata and URLs in database
- Implement tiered storage for cost optimization
- 200x more cost-effective storage
Cost Impact Analysis
The architectural change from database to blob storage provided dramatic cost savings:
- Azure SQL Database: ~$23 per GB/month for storage
- Azure Blob Storage (Hot): ~$0.115 per GB/month
- Cost Reduction: Approximately 200x less expensive for file storage
- Annual Savings: Thousands of dollars for typical usage patterns
Storage Hierarchy
| Container | Purpose | Access Tier | Retention |
|---|---|---|---|
reports |
Generated financial analysis reports | Hot | 1 year |
user-uploads |
User-provided files and data | Hot | Indefinite |
system-backups |
Database and system backups | Cool | 7 years |
temp-processing |
Temporary files during report generation | Hot | 7 days |
archive |
Long-term storage for historical reports | Archive | 10 years |
templates |
Report templates and system assets | Hot | Indefinite |
gmi-downloads |
ZIP downloads built by Download Builder service for folder exports | Hot | Managed by File Purge |
Folder Structure
Reports Container
reports/
report-job-{id}/
job-{jobId}-{timestamp}.xlsxsummary-{jobId}.jsondata-{jobId}.csvFile Naming Convention
job-{jobId}-{timestamp}.xlsxdb-backup-{date}-{time}.sqltemp-{jobId}-{uuid}.tmpSecurity & Access Control
Access Methods
- SAS Tokens: Time-limited access for user downloads
- Managed Identity: Service-to-service authentication
- Connection Strings: Encrypted application-level access
- RBAC: Role-based access control for administrators
Security Features
- Encryption at Rest: Azure-managed AES-256 server-side encryption (SSE)
- Encryption in Transit: HTTPS/TLS 1.2+
- Private Endpoints: VNet-integrated access
- Audit Logging: All access operations logged
Lifecycle Management
Hot Tier
Frequently accessed files
- • Recent reports (30 days)
- • User uploads
- • System templates
Cool Tier
Infrequently accessed files
- • Older reports (30-180 days)
- • System backups
- • Log files
Archive Tier
Long-term storage
- • Historical reports (180+ days)
- • Compliance data
- • Disaster recovery
Performance Features
- CDN integration
- Parallel uploads
- Chunked transfers
- Compression optimization
- Intelligent tiering
Storage Metrics
- Total Capacity: 10 TB
- Current Usage: 2.3 TB
- File Count: ~50,000 files
- Average File Size: 2.8 MB
- Monthly Growth: 150 GB
- Redundancy: LRS + GRS
Automated Processes
- Lifecycle policies
- Automated cleanup
- Tier transitions
- Backup verification
- Cost optimization
Integration Points
- Report Engine uploads
- Web App downloads
- Azure Functions processing
- Mobile app access
- Download Builder ZIP uploads
- Backup services