10 tips for stretching Googleโs free services to the limit and pinning your cloud meter at zero.
The cloud computing industry loves to give away free samples and Google is no different from Amazon or Microsoft in this respect. The companies know that if you give the customers a free taste, theyโll come back when itโs time for a meal.
Google offers two types of free. New customers get $300 to spend on any of the machines or services spread out among the 24 โcloud regions,โ 73 โzones,โ and 144 โnetwork edge locations.โ The money works pretty much everywhere in the Google cloud from raw compute power to any of several dozen different products like databases or map services.
But even when that free money runs out, the free gifts continue. There are 24 different products that offer continuous free samples that are billed as โalways free.โ Even if youโve been a customer for years, you can still experiment. Of course Google adds the caveat that the word โalwaysโ in this generous promise is โsubject to change.โ But until that day comes, the BigQuery database will answer one terabyte of queries each month and AutoML Translation will turn 500,000 characters from one language to another.
Some developers use the free tier for what itโs intended to be: an opportunity to explore without begging their boss and their bossโs boss for a budget. Others work on a side hustle or a website for the neighborhood kids. When the load is small, itโs easy to innovate without dealing with a monthly bill.
Some developers take this to the extreme. They try to stay in the free tier as long as possible. Perhaps itโs because they want to brag about their insanely low burn rate. Maybe itโs just a form of modern machismo. Maybe theyโre low on cash.
In any case, working this free angle as long as possible generally leads to lean and efficient web applications that do as much as possible with as little as possible. When the day comes that they leave the free tier, the monthly bills will stay small as the project scales, something that warms the heart of every CFO.
Here are a few of the secrets for squeezing every last drop of goodness from Googleโs free offering. Maybe youโre cheap. Maybe youโre just waiting to tell your boss until the awesomeness is completely realized. Maybe youโre just having fun and this is a goof. Whatever the case, there are many ways to save.ย
Store only whatโs necessary
The free databases like Firestore and Cloud Storage are completely flexible tools that squirrel away key-value documents and objects respectively. Google Cloudโs always-free tier lets you store your first 1GB and 10GB in each product respectively. But the more details your app keeps, the faster the free gigabytes will run out. So quit saving information unless you absolutely need it. This means no obsessive collection of data just in case you need it for debugging later. No extra timestamps, no large cache full of data youโre keeping just to be ready.
Compression is your friend
There are dozens of good pieces of code for adding a layer of compression to your clients. Instead of storing fat blocks of JSON, the client code can run the data through an algorithm like LZWย or Gzip before sending it over the wire to your server instances, which store it without unpacking it. That means faster responses, fewer bandwidth issues, and less impact on your free monthly data storage quota. Be a bit careful because some very small data packets can get bigger when the overhead from compression is included.
Go serverless
Google is more generous with their intermittent compute services that are billed per request.ย Cloud Runย will boot up and run a stateless container that answers two million requests each month for free.ย Cloud Functionsย will fire up your function in response to another two million requests. Thatโs more than 100,000 different operations each day on average. So quit waiting and start writing your code to the serverless model.
Note: Some architects will cringe at the idea of using two completely different services. It may save money but it will double the complexity of the application and that means it will be harder to maintain. That is a real danger, but often you can more or less duplicate the function-as-a-service structure of Cloud Functions inside your own container, making it possible to consolidate your code later if you plan for it.
Use the App Engine
Googleโs App Engine remains one of the best ways to spin up a web application without fussing over all of the details of how to deploy or scale it. Almost everything is automated so it will deploy new instances if the load grows. The App Engine comes with 28 โinstance hoursโ for each dayโmeaning that your basic app will run free for 24 hours per day and can even scale up for four hours if thereโs a burst of demand.
Consolidate service calls
There is some freedom to add extras if youโre careful. The limits on serverless invocations are on the number of individual requests not on the complexity. You can pack more action and more results into each exchange by bundling all of the data operations into one bigger packet. So you can offer silly gimmicks like stock quotes, but only if you slip the extra few bytes into the absolutely essential packets. Just keep in mind that Google counts the memory used and the compute time. Your functions canโt exceed 400,000 GB-seconds memory and 200,000 GHz-seconds of compute time.
Use local storage
The modern web API offers a number of good places to store information. Thereโs the perfectly good, old-fashioned cookie thatโs limited to four kilobytes. The Web Storage API is a document-based key-value system that will cache at least five megabytes of data and some browsers will keep 10 megabytes. The IndexedDB offers a richer set of features like database cursors and indices that will speed plowing through the data which is often stored without limits.
The more data you store locally on your userโs machine, the less you need to use your precious server-side storage. This can also mean faster responses and much less bandwidth devoted to carrying endless copies of the data back to your server. There will be problems, though, when users switch devices because the data probably wonโt be in sync. Just make sure the important details are consistent.
Find the hidden bargains
Google maintains aย helpful pageย that summarizes all of the โalways freeโ products, but if you poke around youโll find plenty of free services that donโt even make the list. Google Maps, for instance, offers โ$200 free monthly usage.โ Google Docs and a few of the other APIs are always free.
Use G Suite
Many of the G Suite products including Docs, Sheets, and Drive are billed separately and the users either get them free with their GMail account or their business pays for them as a suite. Instead of creating an app with built-in reporting, just write the data to a spreadsheet and share that. The spreadsheets are powerful enough to include graphs and plots like any dashboard. If you build a web app, youโll need to burn your compute and data quotas to handle the interactive requests. But if you just create a Google Doc for your report, youโre dumping most of the work on Googleโs machine.
Strip away gimmicks
Some features of modern web applications are pretty superfluous. Does your bank application need stock quotes? Do you need to include local time or temperature? Do you need to embed the latest tweets or Instagram photos? No. Get rid of all of these extras because each one means another call to your server machines and that eats away at your free limits. The product design team may dream big, but you can tell them, โNo!โ
Be careful with new options
Some of the cooler tools for building artificial intelligence services for your stack offer good limits for experimenting. The AutoML Video service will let you train your machine learning model on video feeds for 40 hours each month, before charges kick in. The service for tabular data will grind your rows and rows of information on a node free for six hours. This gives you enough rope to experiment or build basic models, but watch out. It would be dangerous to automate the process so every user could trigger a big machine learning job.
Keep costs in perspective
Itโs easy to take this game to the extreme and turn your applicationโs architecture into a Rube Goldberg device just to save a bit more cash. Itโs important to remember that the jump from free tier to paying customer is often a pretty tiny step in Google Cloud. While there are many free services on the Internet that jump from free to thousands of dollars with one click, Googleโs services generally arenโt priced like that.
After churning through two million free invocations of Cloud Functions, the next one is a whopping $0.0000004. Thatโs only 40 cents per million. If you dig around your sock drawer, you should be able to cover a few extra million with little trouble.
The price schedule is generous enough that youโre not going to have a heart attack when you step out of the free zone. If your application needs a few extra million this or that, youโll probably be able to cover it. The important lesson is that keeping the computational load low will translate to smaller bills and faster responses.


