Creating solutions in Google Cloud Platform (GCP) involves several challenges, one of them and the main point of this post, is the cost-efficient design. At KochaSoft we always have this in the forefront of our designs.

First of all, it is very important to learn in depth the free tier and cost of the services in GCP. Going from less to more is a good practice to take advantage of the free layer of services, especially during the build and testing phases of the Cloud solutions that we design. On the other hand, we need to create a balance of fulfilling the clients’ requirements and knowing when to use the additional fee-based services to allow us to create cost efficient designs. For example, initially defining low fees for certain services and infrastructure components helps to avoid oversizing, which translates into extra charges in usage billing, even more so when we have the possibility to scale resources vertically and / or horizontally according to the solution requirement.

Reducing costs in GCP is a continuous task, since you must combine technical skills with constant monitoring of your Cloud projects, so you can detect opportunities to optimize expenses. For this, tools such as Stackdriver with extended capabilities and native integration with others services like BigQuery, is a great ally for the generation of metrics that will help you efficiently manage your GCP environment.

Below are some of the principles we apply to make our designs more cost efficient.

Delete everything you don’t need. A clear example of this could be getting rid of obsolete snapshots and also infrastructure components that are not being used by any GCP service, such as unrelated non-ephemeral IP addresses, volumes, etc.

When sizing your infrastructure always go from less to more, as the demand for resources increases, progressively scale the resources of your Cloud environment.

Optimize data storage. We recommend creating policies to automate the management of data stored in GCP. For example, for data in Cloud Storage, create policies based on the time variable to automatically switch from one type of storage to another, Standard → Nearline → Coldline → Archive, with the last options being the least expensive. Flat file and compression formats are also a plus.

If possible, use preemptible VMs. These machines are available for a maximum of 24 hours or less as requested by GCP; due to their low cost, they are an excellent alternative for testing instances, or for example, batch loading for fault tolerant systems.

Establish an on / off schedule for your non-production VMs. Creating a schedule to automate the turning on and off of certain machines, as long as the systems they support allow it will help you reduce costs. Also, you could take advantage of the discounts for continued use that GCP offers. Work with the GCP engineers to establish which saves the most cost for your customer.

Create a budget for your project and consumption alerts based on thresholds. In this way you will avoid surprises and at the same time that you can react proactively to any unexpected surges in use that are required.

Run simulations on the GCP calculator. This tool will help you compare various configurations in GCP, so you can project your future expenses.

Finally, keep in mind that there is no magic recipe to make your designs more cost efficient, but applying a mix of these principles will surely help you.