As software engineers, we often instinctively reach for AWS EC2 instances,
DigitalOcean droplets, or Kubernetes clusters the moment a project requires
compute. But what happens when you impose a strict $0 monthly infrastructure
budget?
Recently, I built and launched SDOWNLOADER, an
ad-clean, high-performance media downloader supporting 9 major social platforms.
Extracting videos—especially merging separate DASH video and audio streams from
Reddit—requires non-trivial CPU and memory resources. This makes it a difficult
fit for standard serverless environments with strict memory and execution
timeouts.
To solve this sustainably without expensive cloud server bills, the entire
platform is built around a decoupled serverless edge pipeline paired with a
custom ARM-optimized transcode worker.
Here is the comprehensive technical teardown of the decoupled architecture that
delivers high reliability and zero-cost scaling.
The 5-Layer Decoupled Architecture
To ensure enterprise-grade uptime, low latency, and continuous availability, the
system strictly decouples edge ingress from backend processing:
[User Browser]
│
▼ (1. Static Edge Delivery)
[Cloudflare Pages] (SvelteKit 2 Static Export, zero blocking CSS, sub-second LCP)
│
▼ (2. Edge Security Gateway & Ingress Protection)
[Cloudflare Worker] (api.sdownloader.online - KV rate limiting & URL allowlist
validation)
│
▼ (3. Asynchronous Database Queue & State Engine)
[Supabase PostgreSQL] (video_jobs queue + automated retention pruning)
▲
│ (4. Asynchronous Polling & Stream Processing)
[Custom ARM-Optimized Transcode Worker]
├── High-Throughput Reverse Proxy
├── Watchdog & Task Supervisor
└── ARM Transcode Engine (Stream extraction & dynamic audio-video muxing)
│
▼ (5. Edge Storage & Streaming)
[Backblaze B2 / Cloudflare Bandwidth Alliance]
- Edge Frontend Layer
The frontend is built using SvelteKit 2 and exported statically onto Cloudflare
Pages:
· Sub-second LCP: Component styles are inlined at build time
(inlineStyleThreshold: 102400), completely eliminating render-blocking CSS
links.
· Interaction-Driven GA4 Telemetry: Analytics tracking is initialized on
user interaction (scroll, click, keydown), keeping Lighthouse Performance at
90+ without sacrificing conversion attribution.
· Direct Database Polling: To avoid burning edge worker invocation quotas,
the client frontend polls the database PostgREST API directly
(/rest/v1/video_jobs) using an anonymous read key.
- Ingress & Security Gateway
The public API gateway runs on a Cloudflare Edge Worker
(api.sdownloader.online):
· Validates incoming URLs against strict allowlists across all 9 supported
platforms.
· Applies IP-based sliding window rate-limiting using Cloudflare KV to defend
against traffic spikes.
· Enqueues verified requests into the database queue and returns a lightweight
jobId in <100ms.
- The Compute Layer: Custom ARM-Optimized Transcode Worker
Heavy compute is handled by a dedicated, low-power ARM worker architecture
optimized for audio-video transcoding:
· Energy-Efficient Dedicated Hardware: ARM-based architectures provide
exceptional performance-per-watt for multimedia operations, allowing
continuous 24/7 background execution without server rental costs.
· Sequential Chunk Streaming: By optimizing network payload streaming with
sequential chunk uploads and extended socket timeouts, large media files
upload reliably without packet drops or stream collapses.
· Process Watchdog Supervision: A lightweight process supervisor
continuously monitors task health, automatically restarting workers in the
event of transient errors.
- Solving the Reddit DASH Audio Nightmare
Reddit hosts media on v.redd.it using Dynamic Adaptive Streaming over HTTP
(DASH). The video stream contains zero audio; the audio track is stored in a
separate fragmented stream.
Most free downloaders fail here, serving muted clips. In our custom ARM
transcode pipeline:
- The engine fetches both video and audio manifests simultaneously.
- The transcode worker multiplexes the streams into a unified high-definition MP4 with perfect lip-sync.
- The resulting container is streamed directly to object storage via the Cloudflare Bandwidth Alliance.
- Presigned download URLs are generated with a 20-hour cache TTL matching our 24-hour lifecycle deletion policy.
- Full 9-Platform Production Scope
SDOWNLOADER handles:
· Twitter / X: Original 1080p HD MP4 streams.
· Reddit: Complete DASH audio + video synchronization.
· SoundCloud & Bandcamp: Pure audio stream extraction to MP3 with bitrate
labeling.
· Pinterest & Threads: Direct video and pin saving.
· Bluesky & Twitch: Live clips and VOD streams.
· Dailymotion: Direct stream redirect delivery.
- The Zero-Popunder Policy & User Experience
Legacy downloaders monetize by opening shady popunders, triggering deceptive
download alerts, or pushing unwanted software.
Because our architecture eliminates cloud server overhead, we do not engage in
predatory monetization:
· 0 popunders or deceptive redirects
· 0 fake download buttons
· No software, app, or browser extension installations
· Only clean, non-intrusive display banners to offset yearly domain
registration.
Live Demo & Feedback
The entire stack is running live right now. You can test the latency and speed
of our decoupled pipeline yourself:
Try downloading a Reddit clip with audio or an original 1080p Twitter video.
If you have questions about designing decoupled serverless edge pipelines,
optimizing ARM transcode workloads, or building zero-budget microservices, drop
your questions in the comments below!
Note: The GitHub repositories for this project are not public yet due to
ongoing security audits, database migrations, and documentation updates. They
will be open-sourced once these processes are completed.

Top comments (0)