For the last 4–5 years we have all learned a lot about containers. Technologists have embraced their portability, inherent security benefits, and best of all the really cool abilities to spin up, tear down, and scale that container orchestration brings. What could possibly be better than this?
Before I answer this question let me provide some background. My pandemic hobby was to build a web platform for restaurants to create QR codes. I very much wanted to help with the transition to contactless menus since I’ve always suffered anxiety from the restaurant industry’s inherent problems with scaling. I’d almost always rather order food online/pay via phone than wait for someone to serve me. For now let’s examine this app:
The design consisted of a React front end, Node.js middleware API server, and Mongo/Firestore backend databases. The architecture I started out with was Kubernetes based. I wanted to create an architecture that would allow me to embrace open source technologies while providing the means to scale easily if this product took off. I created my CI/CD workflow to automatically publish new containers in my cluster, generate SSL certificates, and even host my own Mongo DB. Latency was low, automation was high, things worked great!
However, one problem remained, I had no customers. The demo system cost me roughly $100 a month to run, which while not much money was a bit annoying when I had 0 users. This caused me to rethink how my setup was architected and if you’re skimming this article here’s where it gets good. My app really only needed to load quickly in very specific time windows. It was designed for restaurants which have very common hours of operation and predictable peak customer traffic periods. There was little reason my app needed to have low latency at say 4AM. This led me towards a new technology which I strongly believe the world will be using in the near future to further align their application delivery with user demand cycles in a predictable cost structure. This technology is called Cloud Run and is based on the open source Knative framework for serverless applications that Google has pioneered.