Work / Cloud and Infra / GreenScale

Capstone · Carbon-aware routing

Route around the coal grid.

Serverless platforms route by latency and price. They ignore that one region is burning coal at 720 gCO₂ per kWh while the next runs on hydro at 90. GreenScale fixes that. Same request, same SLA, cleaner electron.

3Cloud Run services
4DCarbon · cold-start · latency · cost
0Idle cost (min-instances=0)
2Research gaps closed
1Bash deploy.sh, idempotent

Act I · The Problem

Latency-aware routing was solved.
Carbon-aware routing was ignored.

Every serverless platform from AWS Lambda to Cloud Run will pick the region with the fastest cold-start or the lowest list price. None of them ask: is this region's grid burning coal right now? GreenScale was built around the two gaps the literature still has.

Gap 01

The four-axis decision is not made anywhere.

Existing routers optimise one or two axes. Nobody combines carbon intensity, cold-start probability, p95 latency and per-request cost into a single ranked decision per request.

Gap 02

Carbon data is stale by the time it is used.

Most "green cloud" tooling pulls daily averages. Grid intensity moves in fifteen-minute windows. By the time the dashboard updates, you have already paid the carbon.

Reality 01

Cold starts cost both seconds and watts.

Routing a request to a cold region adds 800ms and a fresh container boot. That boot itself draws power. The router has to know which regions are warm right now.

Reality 02

Spot pricing changes the answer.

A region that is dirty and expensive at 9am can be clean and cheap at 2pm. The decision must re-rank continuously, not at deploy time.

Act II · The Promise

One router. Four signals.
Per request. Per second.

A request comes in. GreenScale ranks every healthy region by carbon, cold-start risk, latency and cost. Picks one. Logs the decision. Shows it on a live world map at /, with the trade-off broken down so anyone can audit it.

Act III · The Product

Three services. One decision.

  1. 01 · Backend · FastAPI

    The routing engine itself.

    Combines a carbon model, a cold-start model and a latency probe into a multi-objective scorer. Picks one region per request. Runs on Cloud Run with min-instances=0 so idle cost is zero rupees.

  2. 02 · Database · FastAPI + SQLite

    Persistence with a Cloud Storage round-trip.

    Decisions, regional snapshots and pitch slides persist to SQLite. The DB service syncs to a GCS bucket so a fresh cold start rebuilds state, not loses it.

  3. 03 · Frontend · nginx + Leaflet

    A live world map and a decision feed.

    Static HTML, CSS and JS over nginx. Leaflet for the map, Chart.js for the trade-off plots. Loads on a 2G connection. Includes a pitch deck with arrow-key navigation and a downloadable .docx report at /report.

  4. 04 · Deploy · one bash script

    All three services, idempotent, in minutes.

    bash deploy/deploy.sh ships every service. Or piecewise: deploy.sh db, deploy.sh backend, deploy.sh frontend. The script regenerates the report (HTML + docx) before each frontend deploy.

Act IV · The Stack

What is inside.

  • Python 3.11+
  • FastAPI
  • SQLite
  • Google Cloud Run
  • Cloud Storage
  • nginx
  • Leaflet
  • Chart.js
  • Docker
  • Bash

Carbon Model

Per-region intensity

Maps each region to its grid carbon profile so the scorer can rank.

Cold-start Model

Probability per region

Tracks recent invocations to estimate the chance the next request boots a cold container.

Latency Probe

p95 per region

Continuous health probes feed an SLA-aware penalty into the score.

Cost Layer

List price per request

Adds the egress and per-invocation cost so a "green" decision is also defensible to finance.

Decision Feed

Every choice, logged

JSON line per request with the full trade-off breakdown. Auditable end-to-end.

Report Generator

HTML + docx

One JSON source feeds both the in-app HTML report and the downloadable Word file at /report.

Credits · Built by

Builder

Anshuman Mohanty

B.Tech CSE Cloud Computing, Yogananda School of AI, Computers and Data Sciences, Shoolini University. Roll number GF202217744. Capstone project.

Capstone Mentor

Mr. Ashish

Faculty mentor, Shoolini University.

Engineering Mentor

Divya Mohan

dmj.one. Architecture, deployment and the four-axis scorer design.

Act V · Proof

It already ships.

Repo · divyamohan1993/greenscale

Public source. Backend, database service, frontend, build scripts, deploy script and the architecture document, all in one tree.

Live dashboard · / · /pitch · /report

Three surfaces from one frontend: a live world map with the decision feed, an arrow-key slide deck and the full capstone report (with Download .docx).

Cloud Run · min-instances=0

All three services run cold-start-able. No always-on cost. Anyone can fork, run bash deploy/deploy.sh on their own GCP project, and have it live in minutes.

Research framing · docs/research-gaps.md

The two literature gaps that motivated the work, with cited evidence. Architecture decisions in ARCHITECTURE.md. Reproducible from the repo.

Want a router that is honest about which electron it just burned?

I mentor capstones, build carbon-aware infrastructure, and ship multi-region serverless that picks the cleanest region per request. Talk to me.