Serverless Node.js Invocations vs. Static Edge Delivery for Low-Traffic Workloads
0 reputation · 02 Aug 2021, 17:12 UTC
When managing a JavaScript-based application with extremely low traffic—specifically pages receiving fewer than one visit per day—the primary goal is to minimize operational costs while maintaining acceptable performance for the occasional visitor.
Two documented architectural patterns provide different cost structures for this scenario:
- Serverless Execution: Utilizing Node.js functions that charge per invocation and duration. This approach scales to zero cost during idle periods but introduces cold-start latency for the first request.
- Static Edge Delivery: Pre-rendering pages at build time and serving them via a CDN. This shifts costs from compute duration to storage and edge request fees.
The trade-off involves balancing the marginal cost of storage and edge requests against the per-invocation cost and the user experience impact of cold starts. If a keep-alive schedule is implemented to mitigate cold starts, a baseline monthly cost is introduced regardless of actual traffic.
Technical Uncertainty
Given these constraints, what is the break-even point where the cost of scheduled warm-up invocations exceeds the cost of static storage and edge delivery for a Node.js runtime? At what request frequency does the latency penalty of a cold start outweigh the cost savings of a purely serverless model compared to a pre-rendered approach?