Back to Insights_ArchiveNODE // CASE_STUDY
case study#Serverless#Cloud Optimization#Cost Engineering#AWS#Vercel

Reducing Cloud Costs by 60% with Serverless & Edge Compute

A technical case study on eliminating idle compute overhead by migrating traditional long-running VM clusters to event-driven serverless functions and edge runtime workers.

S

Sameer Bagwan

CTO & Co-Founder, Digitat

2026-02-04
6 min read
Reducing Cloud Costs by 60% with Serverless & Edge Compute

Executive_Summary // Key Takeaways

  • Provisioning for peak traffic in traditional VM clusters causes 70%+ compute waste during off-peak hours.
  • Edge execution eliminates cold starts for read APIs by keeping runtimes lightweight and geographically distributed.
  • Connection pooling proxies are mandatory when serverless functions query relational SQL databases.
  • Targeted cost allocation tagging gives engineering teams visibility into per-tenant compute expenses.

01.The Economics of Idle Compute

For modern SaaS applications, compute traffic follows cyclical patterns: peak usage during business hours and minimal activity during nights and weekends. Traditional monolithic deployments require infrastructure sized to handle peak concurrency, leaving servers idle for up to 70% of each week.

By switching to an event-driven serverless architecture, compute costs scale linearly with actual request volume, virtually eliminating costs during idle periods.

02.Solving the Serverless Database Connection Bottleneck

The greatest historical friction with serverless execution is database connection saturation. When thousands of ephemeral function instances spin up simultaneously, traditional PostgreSQL connection pools quickly run out of sockets.

We resolve this by deploying dedicated transaction-level connection poolers (such as PgBouncer or AWS RDS Proxy) and leveraging HTTP-based serverless database drivers.

serverless-db.ts
typescript
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";

// Optimized for ephemeral serverless execution
const connectionString = process.env.DATABASE_URL!;
const client = postgres(connectionString, {
  max: 1, // Single connection per ephemeral instance
  idle_timeout: 10,
  connect_timeout: 5,
});

export const db = drizzle(client);

03.Real-World Cost Reductions and Latency Gains

Across our production deployments, moving from over-provisioned Kubernetes clusters to edge compute and serverless workers reduced monthly cloud bills by 62% while simultaneously cutting p95 page load latency from 480ms to 92ms worldwide.

S
Published By

Sameer Bagwan

CTO & Co-Founder, Digitat

Discuss System Architecture
Related_Intelligence

Continue Reading

View All (7) →