Wildfire Incident Response

System architecture / addendum

Scaling nationwide

Load · SLOs · observability · deployment · migration

This page is written the way a systems design interview runs. It starts from what this build actually runs, sizes the national problem, shows where today's design breaks, and then lays out what a mission-critical version would look like and how to get there in stages. Numbers marked as estimates are order-of-magnitude reasoning from public figures, not measurements or quotes.

One idea carries most of the design. Every snapshot already has a revision hash, and every briefing and decision is pinned to one. Content that is addressed by its hash never changes, so the read path can be cached at the edge almost for free. The hard scaling problem is the write path: fetching, decoding and modelling fast enough, for every incident, without hammering free public APIs.

01

Where we are

Today the build covers USFS Region 2 (Colorado, Wyoming, South Dakota, Nebraska and Kansas). It reads 31 public sources. The app runs on Vercel Pro, and Neon Postgres is the one service still on a free tier, which is the right call while it is under construction and the first thing to change for anything real.

Public sourcesVercel Pro · and the browserManaged storage and APIs31 feeds + contextNIFC WFIGSNASA FIRMSNWS · HRRR · SPCNOAA HMS · LANDFIRE3DEP · Census · HIFLDCloudflare Workercron */10 minBearer CRON_SECRETGET /api/ingest300 s max duration5 min lease, one writer≤ 12 incidents, serial~42 fetches per runNext.js consolesnapshot per requestarchive first, else livetemplate or Claudebriefing + decisionBrowser (Leaflet)raw GeoJSON layersEsri basemap tilesGoogle OAuth allowlistpublic read-only modeCloudflare R2 · wildfire-feedspayloads/<sha256>.gz≈ 20 MB/day (estimate)Neon Postgres (free tier)feed_fetches · ingest_runs (60 d)approval log · LLM spend0.5 GB storage capAnthropic API$5/day site capper-user caps for demo ICsevery 10 minput payloadindex rows
Today. One scheduler, one function, one lease, one region. Vercel is on Pro; Neon is the one free tier.
Current production footprint
PieceWhat it is todayReal number
SchedulerCloudflare Worker cron, plus a daily Vercel cron as backstopevery 10 min
IngestOne Vercel function builds Region 2 snapshots through an archiving feed client≤ 12 incidents, ~42 fetches on the first live run, 300 s limit, 5 min lease
Payload archiveCloudflare R2, gzipped and keyed by SHA-2560.5–1 MB per sweep, ≈ 20 MB/day (estimate)
Index and decisionsNeon Postgres free tier60 day prune on fetch rows, 0.5 GB cap
ModelRothermel surface and crown fire, in the requestmilliseconds per incident
LLMClaude briefings and agents for invited users$5/day site cap, per-user caps
AuthGoogle OAuth allowlist, public read-only modea handful of users
ObservabilityVercel logs, ingest_runs table, the audit viewno alerting, no on-call

What is already right, and survives the move: envelopes that record every request and its fetch time, freshness judged per source, revision-hashed snapshots, a briefing floor that never needs the LLM, an append-only decision log, and replay. Those are the properties a mission-critical system needs. The work ahead is mostly plumbing around them.

02

National requirements

Nationally the load is seasonal and spiky. Most days are quiet; a few weeks a year, several geographic areas are at preparedness level 4 or 5 at once, and that is exactly when the system has to hold.

National requirements
DimensionOrder of magnitudeWhy it matters
FiresAbout 60,000 wildfires a year (NIFC 10-year average); hundreds of open incidents in peak season, 60 to 100+ of them largeTracked incidents grow ~25× from Region 2 today
Geography10 GACCs, CONUS plus Alaska and HawaiiNatural partition key and blast-radius boundary
UsersDozens of incident management teams, every GACC coordination center, local dispatch, agency administrators, cooperatorsA few thousand concurrent internal users on a peak day; public traffic can spike far higher during evacuations
DetectionsVIIRS from three satellites, MODIS, and GOES scans every 5 minutes (1 minute in mesoscale sectors)Tens of thousands of points on a bad day, arriving in bursts after each overpass
WeatherHRRR hourly at 3 km, about 1.9 million grid cells, 18 to 48 hours outUpwind and afternoon wind shifts are the core value, so this is the critical feed
Freshness targetsDetections within minutes of publication; perimeters within one publication cycle; HRRR within an hour of the runThese become the SLIs below
03

Capacity math, and where it breaks

Today each incident fans out into its own weather, forecast and context calls, about 15 per incident. That is fine for 12 incidents and breaks at national scale.

Capacity math
QuantityRegion 2 todayNational peak (estimate)
Incidents tracked≤ 12~300
Upstream calls per sweep~42~4,500 with per-incident fan-out
Upstream calls per day at 10 min~6,000~650,000
Archive written≈ 20 MB/day~0.5 GB/day before grids; HRRR subsets add a few GB/day
Index rows (Postgres)~6 MB/day (estimate)~150 MB/day, partitioned and pruned
Briefingson demand, capped at $5/day~100 large fires × 6 per day, plus agents: tens to low hundreds of dollars a day
Map payloadraw GeoJSON per pagenational perimeters and detections need vector tiles
Today · fan-out per incidentNational · fan-in per gridIncident 1Incident 2Incident 3Incident nOpen-Meteo pointNWS gridpointContext lookupsHRRR on S3once per hourGOES FDC on S3once per scanGrid cacheZarr chunksper GACCIncident 1Incident 2Incident 3Incident n
The one change that matters most: stop asking upstream once per incident, and fetch each grid once.

Where the current design breaks, roughly in the order it would happen:

  • Upstream quotas. Open-Meteo's free tier is non-commercial and limited to 10,000 calls a day. National point queries blow through it in an hour. Fix: fetch HRRR and GOES as grids from NOAA's open data buckets and sample locally (the fan-in above).
  • One function, one lease. A single 300 s function and a single 5 minute lease mean one writer working serially. Fix: a queue keyed by source and GACC, many idempotent workers, and per-partition leases.
  • Storage tiers. Neon's 0.5 GB cap lasts days at national volume. Fix: paid Postgres with PostGIS, partitioned by GACC and day, with read replicas.
  • Hosting terms. Vercel Pro allows commercial use and crons as often as every minute, so a pilot can stay on it. Fix: containers or functions on AWS for anything sold to an agency that requires them.
  • Client maps. Raw GeoJSON is fine for one incident and too heavy for a national view. Fix: a tile pipeline (PMTiles or a tile server) keyed by revision, behind the CDN.
  • LLM spend. Per-request generation does not scale with viewers. Fix: generate once per snapshot revision after ingest, cache by hash, and budget per tenant.
  • Operations. No alerting means a stale feed is found by a user. Fix: SLOs, burn-rate alerts and an on-call rotation (sections 5 and 6).
04

Target architecture

The target keeps today's stages and changes how they are wired: queues between stages, workers that can be retried safely, storage partitioned by geographic area, and work triggered by change instead of by page views.

Region cell · one per GACC group, two AWS regionsBulk sourcesHRRR GRIB2 (S3)GOES FDC (S3)FIRMS · WFIGSIRWIN · EGP (gov)Schedulersper source cadenceETag / If-ModifiedS3 new-object eventsWork queuekey: source × GACCDLQ + retry budgetlag is an SLIFetch workersidempotent byrequest hash × bucketdecode, normalizegrid → point sampleObject storageraw payloads by hashZarr / COG gridsversioned, replicatedPostGISpartitioned GACC × dayincidents, detectionssnapshots, decisionsread replicasChange eventsrevision hash moved→ snapshot builder→ model workersModel + LLM workersRothermel, ML inferencebriefings by revisionper-tenant budgetstemplate fallbackAPI + tilessnapshot APIvector tiles (PMTiles)immutable by hashCDN + consoleIMTs, GACCs,dispatch, cooperatorsagency SSO / PIVRBAC by incidentObservability plane · OpenTelemetrytraces: fetch → normalize → snapshot → briefing · metrics: feed age per source × GACC, queue lag, LLM tokens and $ per incidentSLO burn-rate alerts (1 h / 6 h windows) → on-call · feed-freshness board · eval and citation-failure dashboards · audit log to WORM storageSecond region (warm standby)PostGIS streaming replicaobject storage cross-region copyRPO 0 for decisions, 15 min for feedsEdge kit at the ICPk3s + Postgres + cached tilestemplate briefings offlinehash-chained log syncs when linkedIntegrationsTAK / CoT out, AVL inCAD and IROC (gov)webhooks for GACC desks
Target. The same pipeline stages, split into queues and workers, partitioned by GACC so one region's surge or outage stays in its cell.
Target architecture components
StageDesignWhy
SchedulingOne scheduler per source at its own cadence, using ETag and If-Modified-Since; S3 new-object notifications for HRRR and GOESFetch when data changes, not on a clock
QueueSQS or Cloudflare Queues, keyed by source × GACC, with dead-letter queues and a retry budgetVolume is about a gigabyte a day; a log like Kafka adds cost without need until replay streams matter
Fetch workersIdempotent on request hash × time bucket; write raw payload first, then normalizeA retry or duplicate delivery never double-writes
StorageObject storage for raw payloads and gridded data (Zarr or COG); PostGIS partitioned by GACC and day for normalized rows, snapshots and decisionsSpatial queries stay local to a cell; old partitions drop cheaply
Snapshot and modelA change event (revision hash moved) triggers the snapshot builder, then model workers; ML inference on CPU is enough for the corrected physics modelCompute follows data changes, not viewers
Briefings and agentsGenerated once per revision, cached by hash, budgeted per tenant; the template briefing is always produced firstThe LLM is additive and never on the critical path
ServingSnapshot API and vector tiles, immutable by revision hash, behind a CDN; the console polls a tiny "latest revision" endpointThousands of viewers of one fire cost one origin read
CellsOne cell per group of GACCs, each with its own queue, workers and database partition setA surge in California cannot starve the Rockies
05

Reliability

The measures that matter to an IC are freshness and whether the page answers, not CPU. The SLIs are written from the user's side, and the targets tighten between the pilot and mission-critical stages.

Service level indicators and objectives
SLIHow it is measuredPilot SLOMission critical SLO
Feed freshnessShare of minutes each tier-1 feed (FIRMS, WFIGS, HRRR, NWS alerts) is within its freshness limit, per GACC99% in season99.9% in season
Snapshot lagTime from a feed change landing to a new snapshot revisionp95 < 10 minp95 < 2 min
Console availabilitySuccessful console and API responses, from synthetic probes in each GACC99.5% monthly99.95% monthly (~22 min)
Briefing latencyTime to a cited briefing for the current revisiontemplate p95 < 2 s; Claude p95 < 60 stemplate p95 < 1 s; Claude pre-generated before the first viewer
Briefing correctnessShare of statements with a valid citation; eval pass rate on the backtest set100% citations (hard gate)100% citations; eval regressions block release
Decision durabilityDecisions acknowledged and later readableno lossno loss, synchronous replica

Error budgets are spent in season and earned back out of season: risky migrations, schema changes and model upgrades land between November and March, and a freeze on non-urgent changes starts when national preparedness reaches level 4.

Degraded modes
FailureWhat the IC seesExists today?
An upstream feed is downLast good copy with its age in amber; the briefing says which input is staleYes
LLM provider is down or over budgetThe template briefing, fully citedYes
Snapshot changed under a decisionA warning listing what changed, with an override that is recordedYes
Database primary is lostRead-only from the replica and archive; decisions queue client-side and replay in orderNo
Region is lostFail over to the warm standby regionNo
No connectivity at the ICPThe edge kit keeps working on cached data and syncs laterNo
Recovery objectives
DataRPORTOReasoning
Decision log015 minA legal record; synchronous replica, append-only and hash-chained
Snapshots and briefings≤ 15 min15 minRebuildable from the archive by hash
Feed archive≤ 1 h1 hMostly re-fetchable upstream; cross-region object copy
Model artifactsper release1 hVersioned in object storage, pinned per snapshot
06

Observability

Today the audit view shows the last ingest run and Vercel keeps logs. That is enough to debug, not to operate. The mission-critical version adds:

  • One trace per incident revision. OpenTelemetry spans from fetch to normalize to snapshot to model to briefing, tagged with source, GACC and revision hash, so “why is this briefing old” is one query.
  • A feed-freshness board. Age of every source in every GACC against its limit. It is the first screen on-call opens, and it doubles as a public status page.
  • Queue and worker metrics. Lag per partition, retry and dead-letter rates, and upstream error codes, so a NASA or NOAA outage is distinguished from ours.
  • LLM telemetry. Tokens, dollars and latency per incident and tenant, cache hit rate by revision, citation-failure rate, and nightly eval scores on the backtest set.
  • Alerting on burn rate. Multi-window SLO burn alerts (fast over 1 hour, slow over 6 hours) page on-call; everything else is a ticket. Each tier-1 feed has a runbook.
  • On-call. A follow-the-sun or two-site rotation of at least six engineers in season, with incident review after every page. Audit and access logs go to write-once storage.
07

Deployment models

Deployment models
ModelWho it servesShapeMain cost
Commercial SaaSCounties, states, utilities, contractorsMulti-tenant on a commercial cloud, SOC 2, tenant isolation by row and by cellLowest; fastest to sell
FedRAMP on GovCloudUSFS, DOI agencies, federal IMTsAWS GovCloud, FedRAMP Moderate to start, agency SSO (PIV, Login.gov, USDA eAuth); Claude through Amazon Bedrock in GovCloudA 12 to 18 month authorization effort and a continuous monitoring program
Agency-hostedA state or agency that must run it themselvesThe same containers and Terraform, delivered into their accountSupport and upgrade burden
Edge kitAn incident command post with poor connectivityA rugged box running k3s, Postgres and cached tiles; template briefings and the model run locally; syncs over Starlink or cellularHardware, logistics, and sync design

The decision log is already append-only and hash-chained, which makes edge sync tractable: two logs merge by ordering entries, not by resolving conflicts. The security and ATO path follows from that design:

  • Classify the data. Public feeds are public. Resource positions, decisions and pre-release intelligence are controlled; decisions are federal records.
  • Map to NIST 800-53. Identity, audit, encryption at rest and in transit, configuration management, incident response. Most controls inherit from the cloud provider.
  • Supply chain. SBOMs, signed builds, pinned dependencies, and model artifacts versioned like code.
  • LLM boundary. Prompts carry only the snapshot facts the briefing cites; no secrets, no free-text PII; every output is logged with its inputs by hash.
  • Interoperability. IRWIN for incident identity, TAK and Cursor-on-Target out to the field, AVL in when agencies share it.
08

Phased migration

Each phase is usable on its own, and each one is triggered by a real limit, not by ambition. The costs below are itemized from approximate public list prices for a month in fire season. They are planning estimates, not quotes, and they leave out salaries.

Phased migration
PhaseTriggerWhat changesMonthly cost (estimate)
0 · TodayUnder constructionRegion 2, Vercel Pro, Neon free tier, one functionabout $20 plus up to ~$150 of LLM
1 · Western pilotA real user group in two to four GACCsPaid Postgres with PostGIS, grid fetch for HRRR and GOES, Cloudflare Queues, SLO dashboards, pre-generated briefings~$150 infrastructure, $300 to $2,000 LLM
2 · National, leanPaying tenants across CONUSStay on Cloudflare and managed Postgres: Workers and Queues, R2, PMTiles, one small container for GRIB decoding, Grafana Cloud$700 to $2,500 infrastructure, $1,000 to $6,000 LLM
2b · National, full AWSCustomers who require AWS or SOC 2 evidence from itAurora PostgreSQL with a replica, Fargate workers, CloudFront and WAF, a paid observability vendor, SOC 2 tooling$8,000 to $18,000 including LLM
3 · Mission criticalFederal adoptionGovCloud in two regions, FedRAMP Moderate, cells by GACC, edge kits, 99.95% SLO, formal DR tests$15,000 to $30,000 infrastructure, plus ~$15,000 to $25,000 of compliance
Itemized monthly costs in fire season
Line itemPilotNational, leanNational, full AWSFederal (GovCloud)
App hostingVercel Pro, ~$50Vercel Pro or Workers, $150 to $400Fargate and ALB, $800 to $1,500Fargate in two regions, $2,000 to $4,000
Ingest and queuesWorkers Paid, ~$10Workers and Queues, $50 to $200SQS and Lambda, ~$50SQS and Lambda, ~$100
GRIB decoding and tilesin the ingest workerone small container, $50 to $150Fargate tasks, $200 to $400Fargate in two regions, $400 to $800
Postgres with PostGIS$20 to $70primary and replica, $300 to $800Aurora with a replica, $1,500 to $2,500Aurora in two regions, $4,000 to $6,000
Object storageR2, ~$1R2, $15 to $50 (no egress fees)S3, $100 to $300S3 with cross-region copy, $300 to $600
CDN, egress and WAFincludedincluded with CloudflareCloudFront and WAF, $500 to $1,700$1,000 to $3,000
NetworkingnonenoneNAT gateways, $100 to $300$300 to $800
ObservabilityGrafana Cloud freeGrafana Cloud and Sentry, $50 to $300Datadog-class vendor, $2,000 to $5,000FedRAMP SIEM and logging, $3,000 to $8,000
Security toolingnonenoneSOC 2 platform, $1,000 to $2,000scanning and posture tools, $1,000 to $3,000
Agency SSOGoogle OAuth$0 to $500$0 to $500PIV and Login.gov integration, mostly staff time
On-call pagingnone~$150~$150~$300
Edge kitsnonenonenoneabout 20 kits amortized over three years, ~$3,000
LLM briefings and agents$300 to $2,000$1,000 to $6,000$1,000 to $6,000Claude on Bedrock GovCloud, $2,000 to $8,000
Audit and authorizationnonenoneincluded abovethird-party assessment and continuous monitoring, ~$15,000 to $25,000 amortized

The lean national design does the same work as the full AWS one: the data is about a gigabyte a day, which one Postgres primary, a queue and a few workers handle easily. The full AWS column is worth paying for only when customers need it, usually for SOC 2 evidence, an existing AWS contract, or a later move into GovCloud.

Why the federal version costs several times the national one, at the same load:

  • Authorized services only. Vercel, Neon and most of Cloudflare are out. GovCloud list prices run roughly 20 to 30% above commercial AWS.
  • A second live region. A 99.95% target with a decision log that cannot lose a write needs a standby region that is always running, which roughly doubles the infrastructure.
  • Mandatory tooling. FedRAMP logging and SIEM, vulnerability scanning, FIPS-validated encryption and a WAF are fixed costs that do not shrink with load.
  • Audit and continuous monitoring. An annual third-party assessment and monthly monitoring reports cost about as much as the hosting. The 12 to 18 month authorization effort is mostly staff and sits outside these numbers.
09

Tradeoffs an interviewer would push on

Tradeoffs
QuestionAnswer
Why not Kafka?About a gigabyte a day of payloads. Queues with dead-letter handling are simpler and cheaper; a log becomes worth it when many consumers need to replay streams.
Why Postgres and not a time-series database?The queries are spatial and relational (which detections sit inside which perimeter). PostGIS does that well; time partitioning covers the time-series need.
Push or pull?The sources are pull-only HTTP. Pull with conditional requests, and use object-store notifications where NOAA offers them.
What is the unit of consistency?One incident snapshot revision. Everything downstream is keyed by its hash, so readers never see a half-updated picture.
Is the LLM on the critical path?No. The template briefing is the floor and is always produced. The LLM adds, it never gates.
Why not a one-minute cadence everywhere?Most sources publish far less often. Cadence follows each source, and change events drive the rest.
Multi-tenant or one deployment per agency?Multi-tenant cells for commercial; the same artifacts deployed per agency where authorization demands it.
How does it handle one fire with 10,000 viewers?Immutable, hash-addressed snapshots and tiles behind a CDN; the origin serves only a small "latest revision" pointer.
How do you test a system like this?Recorded fixtures for every adapter, historical backtests for the model, replay of real decisions, and game days that kill a feed or a region in the off season.

Back to the system architecture.