Direct-to-Cloud Azure Blob Streaming
Streaming high-fidelity 2048px inspection proxies and raster uploads directly to Microsoft Azure Blob Storage with adaptive concurrency.
Bypassing Serverless Payload Limits
Standard serverless web hosting platforms (including Vercel) enforce a strict 4.5MB request body ceiling. Attempting to upload high-resolution images or batches through typical API routes results in memory exhaustion and 413 Payload Too Large errors.
BestShots solves this via direct client-to-cloud streaming using Microsoft Azure Blob Storage SAS tokens. Under our Previews-Only Cloud Ingestion architecture (ADR 0015), background Web Workers extract normalized 2048px WebP inspection proxies (~250KB–500KB) from camera RAW files client-side. These proxies (along with full-resolution raster images) stream directly from the browser to Azure Blob Storage, bypassing serverless intermediate hops entirely.
The Direct Streaming Workflow
- SAS Token Acquisition: The browser requests a short-lived Shared Access Signature token from
/api/photos/upload-urlscoped strictly to the target project container. - Direct Browser Streaming: The browser streams the WebP inspection proxy (or raster file) directly to Azure Blob Storage over TLS 1.3.
- Completion Notification: Once Azure confirms byte persistence, the client informs
/api/photos/confirm, registering the photo record and parsed EXIF metadata in Neon PostgreSQL.
Network-Adaptive Concurrency
The client upload manager monitors connection quality using navigator.connection metrics and adjusts upload concurrency dynamically:
| Detected Network | Active Upload Slots | Chunk Size |
|---|---|---|
| High-Speed Fiber (>50 Mbps) | 4 Parallel Streams | 8 MB |
| Standard Broadband (15–50 Mbps) | 2 Parallel Streams | 4 MB |
| Constrained Cellular (< 15 Mbps) | 1 Sequential Stream | 2 MB |
This adaptive throttling prevents browser memory exhaustion and eliminates dropped connections when uploading thousands of frames over studio Wi-Fi.