This weekโs Startup School session, โFrom Prototype to Production, deploying your AI app on Google Cloud,โ was a masterclass in turning a local machine project into a scalable, production-ready application.
Our speakers, Amit and Jeff, guided us through two powerful deployment paths: the streamlined, managed approach with Firebase App Hosting, and the highly customizable solution with Cloud Run.
Jeff showed how the complexity of deploying a modern web app like a Next.js application, which requires server-side rendering, can be drastically simplified.
To deploy a scalable web app, you need a lot of moving parts:
Firebase App Hosting acts as a single platform for rapid app development, wiring together all the necessary Google Cloud products like Cloud Run, Cloud CDN, Cloud Build, and Secret Manager.
app hosting secret set to securely store API keys in Cloud Secret Manager. The key is referenced by name in your apphosting.yaml config file, ensuring it is never accidentally leaked.apphosting.yaml file allows you to tune underlying Cloud Run settings, such as max instances, concurrency, CPU, and memory.Amit then showcased Cloud Run, the fully managed, serverless platform for deploying custom applications and services.
Cloud Run is an event-driven system, meaning you only pay when your service is actively running or โinvoked.โ
| Feature | Description |
|---|---|
| Containers & Source | Deploy any OCI compliant container or directly deploy source code (Next.js, Python, Go, etc.). |
| Services | For running APIs, web applications, or background services that interact with others. |
| Jobs | For back-end tasks that run periodically or on demand, like retraining ML models, data migrations, or generating dynamic reports. Scheduling is done using standard cron job syntax. |
| Traffic Management | Manage traffic distribution between different revisions for A/B testing or gradual rollouts (e.g., 50% to old, 50% to new). |
While serverless saves money, it can lead to โcold startsโ where the service takes a moment to load. Amit shared a brilliant cost-effective solution: