Storage Architecture
The BaseImageStorageService provides shared functionality for all image storage operations.
Blob Path Generationβ
Every image is stored using a time-partitioned path:
{deviceId}/{imageType}/{year}/{month:00}/{day:00}/{hour:00}/{minute:00}/{filename}
This structure:
- Groups images by camera and type for easy retrieval
- Time-partitions by hour and minute for efficient range queries
- Follows Azure Blob Storage best practices for avoiding hot partitions
Base Class Responsibilitiesβ
The abstract BaseImageStorageService handles:
- Blob path generation β Consistent path format across all image types
- Metadata creation β Builds Table Storage entities with image metadata
- SignalR broadcasting β Sends metadata to connected frontends after storage
- Thumbnail generation β Creates resized versions of stored images
Concrete implementations (SingleImageStorageService, PanoImageStorageService, PreStitchedImageStorageService) override only the image-type-specific logic.
Metadata Storageβ
For each image stored in Blob Storage, a corresponding metadata record is written to Table Storage:
| Field | Description |
|---|---|
PartitionKey | Device ID |
RowKey | Timestamp-based unique key |
BlobUrl | URL to the image in Blob Storage |
ThumbnailUrl | URL to the thumbnail |
ImageType | single, panorama, or pre-stitched |
PTZ | Pan/tilt/zoom position at capture time |
Timestamp | Capture timestamp |
This dual-write pattern (Blob + Table) allows fast metadata queries without listing blob containers.