GCP Compute Pricing & Monitoring Service
Redis-cached pricing API for GCP Compute Engine costs
A Go/Echo service that estimates Google Cloud Compute Engine costs — CPU, RAM, GPU, persistent disks/Local SSD, OS/license surcharges, and network egress — against the official Cloud Billing Catalog API, across on-demand, spot, and 1yr/3yr committed-use pricing. A scheduled sync job pulls the full catalog from GCP daily, detects real price changes via content hashing, and atomically swaps MongoDB plus pre-warms a versioned Redis cache, so the request-serving API never calls the GCP API directly and stays fully stateless and horizontally scalable.
Highlights
- Single & batch cost estimation API (POST /api/v1/calculate)
- Redis-cached read path — ~2 round trips per fully-loaded request, near-zero DB calls
- Versioned cache cutover for atomic, fleet-wide price updates with no stale window
- Daily catalog sync with content-hash change detection (skips no-op writes)
- Sustained use discount & spot/committed-use pricing modes
- Redis Cluster support for HA, with pipelined batching around the CROSSSLOT constraint
- Startup schema-version check to prevent serving against a stale derived-field cache
- Docker + Kubernetes deployment (CronJob sync, HPA-scaled API tier)