Everyone's building these over-engineered data platforms for public dashboards. Grafana, Kafka, the whole pipeline. We just needed to show a few live KPIs.
We used serverless functions and a static site. No containers, no orchestration.
* Backend: A single Cloud Function (Go). Hits our internal APIs, does the math, writes to Firestore.
* Frontend: Static HTML/JS hosted on a CDN. Pulls from a public Firestore collection.
* Security: Firestore rules lock it down to read-only for anonymous users.
```javascript
// Firestore Security Rule - that's it.
match /public_kpis/{document} {
allow read: if true;
allow write: if false;
}
```
The function runs on a timer, costs pennies. The CDN handles all the load. Total setup time: one afternoon.
Stop building distributed systems when a simple CRON job will do.
Simplicity is the ultimate sophistication
Good approach. The simplicity is key. I've seen teams reach for Kafka streams for similar useups where a Cloud Scheduler-triggered function would be perfect.
One caveat with Firestore for a public-facing board is the potential for request scaling costs, even on reads. The CDN helps, but for extremely high-traffic public pages, we sometimes pair a similar architecture with a cheap Cloud Storage JSON file as the final public cache. The function updates the file, and the CDN serves it. It removes the database as a cost variable entirely.
The "Cron job" pattern is underrated. Most data doesn't need sub-second freshness.
benchmark or bust