Go to homepage 2sh

Cobalt

Architectural exploration and reference rebuild of an enterprise media platform: dismantling an over-provisioned AWS cluster in favor of edge-native static delivery, cutting monthly cloud spend by 95% while slashing global latency.

view the live build
Cobalt edge-native infrastructure topology vs origin compute
client
Reference Architecture
service
Cloud Cost Optimization & Edge Migration
sector
Digital Publishing / Media Platform
year
2026

the brief

Cobalt is modelled on the technical profile of a venture-backed media and publishing platform paying over €4,000 every month for redundant Kubernetes clusters, application load balancers, and dynamic image compute—all to deliver content that changes only a few times a week.

built with

Astro · Storyblok · Cloudflare

what changed

Replacing dynamic origin compute with edge delivery cuts infrastructure costs from €4,300/mo to €190/mo.

Most cloud architectures are designed for worst-case spike capacity, leaving expensive container clusters, NAT gateways, and load balancers running idle 98% of the time. Cobalt shifts the delivery model: content compiles once at build time into edge-optimized static output. Instead of paying for always-on compute, pages are distributed globally across Cloudflare's edge cache, with origin compute invoked only when webhooks trigger tag-based invalidation.

Monthly compute charges drop by 96%, egress bandwidth is absorbed by edge peering agreements, and dynamic image optimization runs at compile time rather than on expensive on-demand Lambda functions. Total infrastructure spend drops by over €4,100 every single month.

inside the build

the over-provisioning trap

In modern web development, teams routinely throw cloud infrastructure at performance problems.

A digital publication or content platform experiences traffic spikes during a press mention or viral article. To prevent downtime, DevOps engineers stand up redundant Kubernetes pods behind an Application Load Balancer, provision multi-AZ RDS database replicas, configure Redis caching clusters, and set up CloudWatch alarms with auto-scaling triggers.

At the end of the month, the AWS bill arrives:

  • Compute (EC2 / ECS containers): €2,950
  • Data transfer & egress bandwidth: €890
  • Load balancers & NAT gateways: €460
  • Total monthly run-rate: ~€4,300

Yet 95% of the requests hitting that cluster are asking for the exact same article published three days ago. The team is paying enterprise compute rates to repeatedly render static text and images from a database.

the edge inversion

Cobalt inverts the delivery model by moving the source of truth to the edge.

Instead of keeping an expensive cluster running 24/7 waiting for traffic spikes, content is pre-compiled at build time into pure static HTML, CSS, and optimized WebP/AVIF media. The resulting assets are deployed across Cloudflare’s global edge network of 330+ points of presence.

Origin compute is completely eliminated from the critical request path:

  1. Cache hit ratio: 99.5% of all visitor requests are resolved at the edge node nearest to the user, with average global response latency under 18ms.
  2. Instant invalidation: When an editor publishes an update or corrections in Storyblok, a webhook purges the specific surrogate cache tag on Cloudflare in under 15 milliseconds. Only the changed URL re-caches; the rest of the site remains untouched.
  3. Compile-time media: High-resolution photography is processed at build time via Astro’s image pipeline, eliminating on-demand Lambda image transformation fees.

spike immunity without auto-scaling

On traditional cloud setups, traffic surges trigger auto-scaling policies that spin up additional containers—increasing costs precisely when the site is most successful. If the scaling policy is too aggressive, the bill spikes; if it is too conservative, visitors see 504 Gateway Timeouts.

Because Cobalt serves pre-rendered static files directly from edge cache, a 100x traffic spike generates zero additional compute demand. Edge nodes absorb the request volume effortlessly without touching a database, keeping latency flat at sub-20ms while hosting costs remain unchanged.

cost reduction without performance compromise

Cost reduction is usually sold as a trade-off: smaller instances, aggressive throttling, or reduced service quality.

Edge-native static architecture improves performance and cost together:

  • Performance: Mobile Largest Contentful Paint drops from 3.4 seconds to 0.65 seconds, and global Time to First Byte (TTFB) drops from 480ms to 18ms.
  • Cost: Monthly infrastructure spend collapses from €4,300 to under €190—saving over €49,000 annually in recurring cloud overhead.

the benchmark numbers

Cost & Performance Line Item Legacy AWS Cluster (ECS + ALB + RDS) Cobalt (Astro + Cloudflare Edge) Delta
Monthly compute €2,950 / mo (always-on containers) €120 / mo (Workers paid tier) -95.9%
Bandwidth & egress €890 / mo (AWS outbound transfer) €45 / mo (Cloudflare edge peering) -94.9%
Networking & balancers €460 / mo (ALB + NAT gateways) €25 / mo (Edge DNS & routing) -94.6%
Total monthly cloud spend €4,300 / mo €190 / mo -95.6% (€4,110/mo saved)
Global Time to First Byte (TTFB) ~480ms (origin round-trip) 18.3ms (edge cache) -96.2%
Mobile LCP (throttled 4G) 3.42s 0.65s -81.0%
Edge cache hit ratio 58.4% (CloudFront TTL) 99.5% (tag-based edge cache) Origin compute eliminated
Scaling under 100x traffic spike Autoscaling containers (€€€) Flat edge cache (zero cost delta) Spike-immune

in the details

02 views
Cobalt 95% monthly cloud cost reduction billing breakdown
Cobalt 95% monthly cloud cost reduction billing breakdown
Cobalt 99.5% edge cache hit ratio monitoring dashboard
Cobalt 99.5% edge cache hit ratio monitoring dashboard

the result

Dismantling over-provisioned cloud architecture transforms a volatile four-figure monthly expense into a flat, predictable line item under €200, freeing budget for product engineering and growth.

Edge-native static delivery with surrogate-key cache invalidation improves page speeds tenfold while cutting infrastructure overhead by 95%.

credits

Two Shells

Systems Engineering

building something similar?

talk to 2sh