Category Archives: Google Cloud Platform Blog

Product updates, customer stories, and tips and tricks on Google Cloud Platform

Imagine the machine learning possibilities: this week on Google Cloud Platform



Evernote, the latest company to announce their move to Google Cloud Platform, said this week that part of the appeal of GCP is gaining access to “the same deep-learning technologies that power services like translation, photo management and voice search.” Evernote didn’t elaborate on exactly how machine learning might manifest in its productivity software, though, so we thought we’d share some other examples that we’ve come across.

First and foremost, who can forget Makoto Koike, the Japanese farmer who used the Google-developed machine learning library TensorFlow to learn to sort cucumbers according to complex traditional criteria?

Then there are the bright folks over at Google DeepMind and their paper on WaveNet, which generates speech that mimics the human voice with much more natural-sounding results than current text-to-speech systems. Or Google’s recent solutions document in which university art students “experiment with DeepDream algorithms to render digital artwork using machine intelligence.”

Meanwhile, Google Developer Advocate Sara Robinson has unearthed some very practical use cases for machine learning. Check out this post, in which she takes us on on a whirlwind tour of the Cloud Vision API to detect landmarks, and this post on how to use it to filter inappropriate content. She then embarks on a series of posts on using Google Cloud Natural Language with BigQuery. Here’s a post on analyzing twitter posts about the Rio Olympics, and another that compares tweets about Hillary Clinton and Donald Trump.

(Speaking of the Natural Language API, if you need a bit of a primer on how to integrate it into existing projects, check out this post from digital consultancy White October on how to connect Cloud Natural Language API with Python on Google App Engine. Thanks, guys, for as you put it, filling what was “a definite lack of a ‘hello world’ sample showing the basics of how to connect to and call the API.”)

But really, the use cases for machine learning are just early examples, and it’s anyone’s guess what tomorrow’s killer machine learning app will be (Diane Greene discusses some pretty compelling examples of using machine learning starting at the 10:00 minute mark).

Perhaps you’ll be the one to come up with the next great use case for machine learning? Increase your chances by signing up for the new Udacity class on deep learning. Over 61,000 students have already signed up for the free three-month class!

Six Google Cloud Platform features that can save you time and money



Google Cloud Platform (GCP) has launched a ton of new products and features lately, but I wanted to call out six specific features that were designed specifically to help save customers money (and time).


VM Rightsizing Recommendations

Rightsizing your VMs is a great way to avoid overpaying  and underperforming. By monitoring CPU and RAM usage over time, Google Compute Engine’s VM Rightsizing Recommendations feature helps show you at a glance whether your machines are the right size for the work they perform. You can then accept the recommendation and resize the VM with a single click.
Docs
Google Compute Engine VM Rightsizing Recommendations announcement




Cloud Shell


Google Cloud Shell is a free VM for GCP customers integrated into the web console with which to manage your GCP resources, to test, build, etc. Cloud Shell comes with many common tools pre-installed, including Google Cloud SDK, Git, Mercurial, Docker, Gradle, Make, Maven, npm, nvm, pip, iPython, MySQL client, gRPC compiler, Emacs, Vim, Nano and more. It also has language support for Java, Go, Python, Node.js, PHP and Ruby, and has built-in authorization to access GCP Console projects and resources.

Google Cloud Shell documentation

Google Cloud Shell overview
Google Cloud Shell documentation
Using Cloud Shell: YouTube demo
Google Cloud Shell GA announcement



Custom Machine Types

Compute Engine offers VMs in lots of different sizes, but when there’s not a perfect fit, you can create a custom machine type with exactly the number of cores and memory you need. Custom Machine Types has saved some customers as much as 50% over a standard-sized instance. 




Preemptible VMs 


For batch jobs and fault-tolerant workloads, preemptible VMs can cost up to 70% less than normal VMs. Preemptible VMs fill the spare capacity in our datacenters, but let us reclaim them as needed, helping us optimize our datacenter utilization. This allows the pricing to be highly affordable. 
Preemptible VMs overview
Preemptible VMs docs
Preemptible VMs announcement 
Preemptible VMs price drop



Cloud SQL automatic storage increases

When this Cloud SQL feature is enabled, the available database storage is checked every 30 seconds, and more is added as needed in 5GB to 25GB increments, depending on the size of the database. Instead of having to provision storage to accommodate future database growth, the storage grows as the database grows. This can reduce the time needed for database maintenance and save on storage costs.
Cloud SQL automatic storage increases documentation



Online resizing of persistent disks without downtime

When a Google Compute Engine persistent disk is reaching full capacity, you can resize it in-place, without causing any downtime.
Google Cloud Persistent Disks announcement
Google Cloud Persistent Disks documentation
Adding Persistent Disks: YouTube demo

As you can see, there are plenty of ways to save money and improve performance with GCP features. Have others? Let us know in the comments.

Note-able news: Evernote to use Google Cloud Platform



Today, Evernote announced it’s moving to Google Cloud Platform to host its productivity service used by over 200 million people to store billions of notes and attachments. Consumers and businesses using Evernote — on the web or their device of choice — will soon benefit from the security, scalability and data processing power of Google’s public cloud infrastructure.

Moving to the public cloud was a natural progression for the company, as it looks to provide a seamless experience for its users and boost productivity with new features and services. Evernote initially built a private cloud infrastructure that serves users and data on any device, anywhere in the world. By moving its data center operations to Google’s cloud, Evernote can focus on its core competency: providing customers with the best experience for taking, organizing and archiving notes.

Evernote takes customer data protection seriously, so it’s no surprise that security was at the top of its list of selection criteria. With Google Cloud Platform, Evernote users will benefit from our world class security, while strengthening the company’s commitment to its own Three Laws of Data Protection.

Evernote evaluated multiple public cloud vendors and specifically chose Google Cloud Platform for our advanced data analytics and machine learning capabilities. By taking advantage of the advancements in machine learning such as voice recognition and translation, Evernote will continue to explore innovative new features that allow users to naturally capture their ideas at “the speed of thought.” You can learn more about Evernote’s plans and selection criteria here.

We here at Google Cloud Platform are excited to build on our partnership that began with the integration of Google Drive and Evernote. We welcome Evernote and look forward to the exciting journey ahead of us!

Prototyping kit gets your IoT app on Google Cloud Platform, fast



The Internet of Things provides businesses with the opportunity to connect their IT infrastructure beyond the datacenter to an ever-increasing number of sensors and actuators that can convert analog information to digital data, and we believe Google Cloud Platform (GCP) is a great landing place for that valuable information. Whether it’s handling event ingest in Google Cloud Pub/Sub, processing the streams of data from multiple devices with Google Cloud Dataflow, storing time-series data in Google Bigtable, or asking questions across IoT and non-IoT data with Google BigQuery, GCP’s data and analytics products can help you manage that IoT data and turn it into something relevant.

Just like software, it's useful to prototype and validate your IoT project quickly. Unfortunately, not all businesses have a bench of electrical engineers and embedded software developers on staff. That’s why we’ve teamed up with Seeed Studio and Beagleboard.org to bring you the BeagleBone Green Wireless IoT Developer prototyping kit for GCP.

Features of the BeagleBone IoT prototyping kit include:
  • New improvements to the original BeagleBone Green, including built in Wi-Fi and Bluetooth radios
  • A fully open hardware design
  • Built-in Grove connectors that allow for prototyping without the need for soldering or complex breadboard work
  • Built-in onboard flash that lets you treat SD cards as optional, removable storage
  • Built-in PRU real-time co-processors that are well suited for certain industrial protocols
  • Built-in analog-to-digital conversion, key for many IoT prototyping situations

With the BeagleBone Green Wireless IoT Developer prototyping kit, you'll be able to get data from the world around you directly onto GCP within minutes. From there, you can use any of our client libraries on the board's familiar Debian Linux operating system.

Learn more about the kit and demo! Don’t have the kit yet? Buy one here, or use your phone as a simulated device. Most importantly, let us know how it goes.

Running Powershell on Google Cloud SDK



It’s exciting to see so many options for .NET developers to manage their cloud resources on Google Cloud Platform. Apart from the usual Google Cloud Console, there's Cloud Tools for Visual Studio, and the subject of this post: Cloud Tools for PowerShell.

PowerShell is a command-line shell and associated scripting language built on the .NET Framework. It's the default task automation and configuration management tool used in the Windows world. A PowerShell cmdlet is a lightweight command invoked within PowerShell.

Cloud Tools for PowerShell is a collection of cmdlets for accessing and manipulating GCP resources. It's currently in beta and allows access to Google Compute Engine, Google Cloud Storage, Google Cloud SQL and Google Cloud DNS —with more to come! For other services, you can still use the gcloud command line tool inside Google Cloud SDK Shell.

Installation


PowerShell cmdlets come as part of the Cloud SDK for Windows installation, so make sure that you’ve checked the PowerShell option when installing Cloud SDK.

If you want to add PowerShell cmdlets into an existing Cloud SDK installation, you’ll need to do a little more work.

First, you need to install cmdlets using gcloud:

$ gcloud components install powershell

Second, you need to register cmdlets with your PowerShell environment. This is done by running a script named AppendPsModulePath.ps1 (provided by Cloud SDK) in PowerShell. Depending on whether Cloud SDK was installed per user or for all users, you can find this script either in

%AppData%\..\Local\Google\CloudSDK\google-cloud-sdk\platform\GoogleCloudPowerShell\

or

C:\Program Files (x86)\Google\CloudSDK\google-cloud-sdk\platform\GoogleCloudPowerShell\

Authentication

As with any other Google Cloud APIs, you need to be authenticated before you can use cmdlets. Here's the gcloud command to do that:

$ gcloud auth login


PowerShell cmdlets


Once authenticated, you're ready to use GCP cmdlets within PowerShell. Here’s an example of using Get-GceInstance cmdlet to list properties of a Compute Engine instance:


Here’s another example of creating a Google Cloud Storage bucket using New-GcsBucket cmdlet:

Here are some of the tasks you can perform with PowerShell cmdlets against a Google Compute Engine instance:

  • Create a Compute Engine VM instance.
  • Start, stop and restart an instance.
  • Add or remove a firewall rule.
  • Create a disk snapshot.

Some of the tasks you can perform against Google Cloud Storage are:

  • Create a storage bucket.
  • List all the buckets in the project.
  • List the contents of a bucket.
  • Get, or delete an item in a bucket.


We also have guides on how to administer Google Cloud SQL instances and how to configure the DNS settings for a domain using Cloud DNS.

The full list of Cloud Storage cmdlets can be found here.


Summary

With Cloud Tools for PowerShell, .NET developers can now script and automate their Compute Engine, Cloud Storage, Cloud SQL and Cloud DNS resources using PowerShell. Got questions? Let us know. Bugs? Report them here. Want to contribute? Great! Care to be part of a UX study? Click here! We’re ramping up our efforts for Windows developers, and would love to hear from you about the direction you want us to take.


Google to acquire Apigee



Today, we’re excited to announce that Google has entered into a definitive agreement to acquire Apigee, a provider of application programming interface (API) management. APIs  the mechanism developers use to interface and integrate with outside apps and services  are vital for how business gets done today in the fast-growing digital and mobile marketplace. They're the hubs through which companies, partners and customers interact, whether it's a small business applying online for a loan or a point of sale system sending your warranty information to the manufacturer.

Apigee is already used by hundreds of companies, including Walgreens, AT&T, Bechtel, Burberry, First Data and Live Nation. Walgreens, for example, uses Apigee to manage the APIs that enable an ecosystem of partners and developers building apps using Walgreens APIs, including the Photo Prints API (enabling mobile app developers to include the ability for their app users to print photos at any Walgreens store), and the Prescription API (enabling users to quickly order refills of prescriptions right from their mobile app). The benefits of interacting digitally drives a large market opportunity; Forrester predicts that US companies alone will spend nearly $3 billion on API management by 2020.

The addition of Apigee’s API solutions to Google cloud will accelerate our customers’ move to supporting their businesses with high quality digital interactions. Apigee will make it much easier for the requisite APIs to be implemented and published with excellence.

Offering a good API goes well beyond having the company develop and publish a performant specification of the interface. A good API needs to support security, give developers the freedom to work in the development environment of their choice and allow the company to continue to innovate its service while supporting a stable interface to the apps and services using the API. Finally, a good API includes testing support and usage analytics to guide the company’s developers.

Apigee’s products handle all of these challenges and that is why the company was recently named a leader in the Gartner Magic Quadrant for Application Services Governance and recognized for its “Completeness of Vision.”

Google cloud customers are already benefitting from no sys-ops dev environments, including Google App Engine and Google Container Engine. Now, with Apigee’s API management platform, they'll be able to front these secure and scalable services with a simple way to provide the exported APIs.

Looking ahead, Kubernetes will be integrated to help enterprises get better control and visibility into how their internal systems talk to one another, an additional part of deploying services. As always, we'll make sure that these capabilities are available in the public clouds and can also be used on-premises.

The transition toward cloud, mobile and digital interaction with customers and partners via APIs is happening, and fast. It’s happening because customers of every stripe  in the consumer realm and in the enterprise  are demanding it, and because it translates to engaging and valuable businesses.

We’re thrilled to be bringing these new capabilities to our customers, and we look forward to welcoming the talented Apigee team to Google.



This blog post includes forward-looking statements within the meaning of Section 27A of the Securities Act of 1933 and Section 21E of the Securities Exchange Act of 1934. These forward-looking statements generally can be identified by phrases such as Google or management “believes,” “expects,” “anticipates,” “foresees,” “forecasts,” “estimates” or other words or phrases of similar import. Similarly, statements herein that describe the proposed transaction, including its financial impact, and other statements of management’s beliefs, intentions or goals also are forward-looking statements. It is uncertain whether any of the events anticipated by the forward-looking statements will transpire or occur, or if any of them do, what impact they will have on the results of operations and financial condition of the combined companies or the price of Alphabet or Apigee stock. These forward-looking statements involve certain risks and uncertainties that could cause actual results to differ materially from those indicated in such forward-looking statements, including but not limited to the ability of the parties to consummate the proposed transaction and the satisfaction of the conditions precedent to consummation of the proposed transaction, including the ability to secure regulatory approvals at all or in a timely manner; the ability of Google to successfully integrate Apigee’s operations, product lines and technology; the ability of Google to implement its plans, forecasts and other expectations with respect to Apigee’s business after the completion of the transaction and realize additional opportunities for growth and innovation; and the other risks and important factors contained and identified in Alphabet’s filings with the Securities and Exchange Commission (the "SEC"), any of which could cause actual results to differ materially from the forward-looking statements. The forward-looking statements included in this blog post are made only as of the date hereof. Google and Alphabet undertake no obligation to update the forward-looking statements to reflect subsequent events or circumstances.

Getting started with Cloud Tools for Visual Studio



If you're a .NET developer, you're used to managing cloud resources right inside Visual Studio. With the recent release of our Cloud Tools for Visual Studio, you can also manage your Google Cloud Platform resources from Visual Studio.

Cloud Tools is a Visual Studio extension. It has a quickstart page with detailed information on how to install the extension, how to add your credentials and how to browse and manage your cloud resources. In this post, I want to highlight some of the main features and refer to individual how-to pages for details.

Installation

You can install the extension in two ways: From inside Visual Studio, you can either go to “Tools” and then “Extension and Updates,” or you can install it from Visual Studio Gallery. The installation section of quickstart page has the installation details.

Authentication

Once installed, you can find “Google Cloud Tools” under “Tools.” “Google Cloud Explorer” is the main tool to browse and manage cloud resources, but before you can use it, you need to add your credentials to Visual Studio.


To add your credentials, select “Manage Accounts.” This opens a new browser window, where you log into your cloud account and add your credentials to Visual Studio.

Google Cloud Explorer

Google Cloud Explorer is a browser for Google Cloud Resources. Once you’ve selected your project from the top dropdown, it displays three different types of cloud resources: Google Compute Engine, Google Cloud Storage, and Google Cloud SQL.
(click to enlarge)
In the Compute Engine list, you can see all your Windows and Linux instances. If you right-click on the instances, you can perform administrative tasks such as opening terminal sessions or resetting Windows usernames and passwords. You can also create an ASP.NET instance (a Windows instance with the ASP.NET stack installed) by right-clicking on the Compute Engine list item. It directs you to Google Cloud Launcher to install the instance, into which you can then deploy your ASP.NET app.

In the Cloud Storage list, you can see all the Cloud Storage buckets you have in your project and navigate to Google Cloud Console to browse the contents of the bucket. Browsing Storage Buckets documentation has more details.

The Cloud SQL list shows all your Cloud SQL instances, and you can easily create data connections to those instances as explained in Browsing Cloud SQL Instances documentation.

Hopefully, this gave you a high level overview of the Cloud Tools for Visual Studio.

Give it a try and let us know in the comments what you think. Any issues? Report them here, or visit our GitHub page if you want to contribute.

"Interested in helping us improve the Google Cloud User Experience? Click here!"

Web serving on Google Cloud Platform: an overview



If you're running a website and considering moving your web serving infrastructure to the cloud, Google Cloud Platform offers a variety of great options. But with so many products and services, it can be hard to figure out what's right for your particular needs. To help you understand the landscape of web hosting options, we recently published a new overview, our Serving Websites guide.

This guide starts with the idea that you're probably already running a site and/or understand a particular set of technologies, such as using a LAMP stack or hosting static pages. The guide tries to meet you where you're at to show you how your current infrastructure and knowledge can map to GCP computing and hosting products, and then links off to relevant documentation, solutions and tutorials that go deeper into the details.

The guide covers the following four main options:


Option
Product
Summary
Google Cloud Storage
Deliver static web pages and assets from a Cloud Storage bucket. This is the simplest option on GCP, and you get automatic scaling with no additional effort.
Google Compute Engine
Install, configure, and maintain your own web hosting stack. You have control of every component, but you also have all the responsibility to keep things running. You also must decide how to provide for load balancing and scalability, from a variety of options.
Google Container Engine
Use container technology to package your dependencies with your code for easier deployment. Then, use Container Engine to manage clusters of your containers.
Google App Engine
Focus on your code, deploy to App Engine, and let Google manage the systems for you. You have a choice of the standard environment, which prescribes the languages and runtimes that you can use, and the flexible environment, that gives you additional options but requires some self-management.

For each option, the guide provides information about things like scalability, load balancing, DevOps, logging and monitoring.

We hope you find this article useful and it makes learning about GCP enjoyable. Please tell us what you think, and be sure to sign up for a free trial!

Manage your APIs with Google Cloud Endpoints



Today we're announcing the open beta release of the newest set of features and open source components in Google Cloud Endpoints, a distributed API management suite that lets you deploy, protect, monitor and manage APIs written in any language and running on Google Cloud Platform (GCP). We're also releasing new versions of the Cloud Endpoints Frameworks for Java and Python that reduce latency, support custom domains and feature improved debugging.

One of the challenges we faced was building an API platform at Google with sufficient performance to handle the surge in microservices in addition to the scale of our web APIs. That led us to develop a server-side proxy that performs traditional API management functions itself. This avoids an additional network hop and in our testing delivers sub-millisecond latency  compared to tens to hundreds of milliseconds with traditional standalone proxies.

And now, we're releasing that architecture to you. The Extensible Service Proxy (ESP) is a NGINX-based proxy designed to run in the server-local architecture. Designed to be deployed in a containerized environment or on its own, ESP integrates with Google Service Control to provide ultra-low latency monitoring, authorization checks, API key validation and many of the other features that Google uses to manage its own APIs.

We're also announcing support for the OpenAPI Specification. We're a founding member of the Open API Initiative (OAI), and recognize the value of standardizing how REST APIs are described. Organizations that adopt the OpenAPI Specification benefit from OAI tooling, while developing their applications in the language and framework of their choice.

Google Cloud Endpoints features

The beta release of Google Cloud Endpoints includes the breadth of API management functionality that you need to manage your own APIs, whether they're accessed from mobile apps, web apps or other services. Today, Cloud Endpoints allows users to monitor the status of critical APIs with usage, error and consumption charts. It logs API calls to Google Cloud Logging and trace information to Google Cloud Trace, and enables powerful analytics by integrating with Google BigQuery. Cloud Endpoints supports end-user authentication through built-in Google authentication and integrations to Auth0 and Firebase Authentication, and creates and validates API Keys to track usage by client.
(click to enlarge)

Cloud Endpoints is designed to allow developers to easily choose the language and framework they want for their backend. Based on the Open API Specification (formerly known as Swagger), Cloud Endpoints supports backends running on Google App Engine Standard or Flexible Environment, Google Compute Engine or Google Container Engine. In App Engine Standard or Flexible Environments, you can transparently add in proxy functionality with a one-line config change, or deploy a containerized version of the proxy on Kubernetes and Container Engine.

GCP customers are already super-charging their development with Cloud Endpoints. "Cloud Endpoints have allowed us to build and ship our APIs faster and more consistently than ever before,” said Braden Bassingthwaite, technical lead at Vendasta. “Not having to worry about authentication, performance and status monitoring has reduced the time and effort we need to build great APIs at Vendasta."

Endpoints Framework for Java and Python

In addition to the new API management features, we're also announcing new versions of the Google Cloud Endpoints API frameworks for Java and Python that run on App Engine Standard Environment. The new versions of those frameworks feature reduced latency, an improved developer experience and support for custom domains. In addition, these new frameworks allow you to opt into the new API management features. To read more about the Endpoints Frameworks, check out the Java and Python documentation.

Try it out

During the initial part of our beta period, the API management features in Cloud Endpoints will be offered at no charge. We will announce final pricing during the beta period.

APIs are an area of focus and investment for GCP. Be on the lookout for upcoming releases from the Endpoints team with support for more use cases and additional functionality, including integration with Identity and Access Management, rate limits and quotas, developer portals and more. Read the documentation to get the know the details. Try our walkthroughs for App Engine (Standard or Flexible Environment, Container Engine or Compute Engine) and join our Google Cloud Endpoints Google Group to send us your feedback.

Building scalable web prototypes using the Google Cloud Platform stack



As a web engineer at Google, I've been creating scaled systems for internal teams and customers for the past five years. Often these include a web front and back-end component. I would like to share with you a story about creating a bespoke machine learning (ML) system using the Google Cloud Platform stack  and hopefully inspire you to build some really cool web apps of your own.

The story starts with my curiosity for computer vision. I've been fascinated with this area for a long time. Some of you may have even seen my public posts from my personal experiments, where I strive to find the most simple solution to achieve a desired result. I'm a big fan of simplicity, especially as the complexity of my projects has increased over the years. A good friend once said to me, “Simplicity is a complex art,” and after ten years in the industry, I can say that this is most certainly true.

Some of my early experiments in computer vision attempting to isolate movement
My background is as a web engineer and computer scientist, getting my start back in 2004 on popular stacks of the day like LAMP. Then, in 2011 I joined Google and was introduced to the Google Cloud stack, namely Google App Engine. I found that having a system that dealt with scaling and distribution was a massive time saver, and have been hooked on App Engine ever since.

But things have come a long way since 2011. Recently, I was involved in a project to create a web-based machine learning system using TensorFlow. Let’s look at some of the newer Google Cloud technologies that I used to create it.

Problem: how to guarantee job execution for both long running and shorter time critical tasks

Using TensorFlow to recognize custom objects via Google Compute Engine

Earlier in the year I was learning how to use TensorFlow  an open source software library for machine intelligence developed by Google (which is well worth checking out by the way). Once I figured out how to get TensorFlow working on Google Compute Engine, I soon realized this thing was not going to scale on its own  several components needed to be split out into their own servers to distribute the load.

Initial design and problem

In my application, retraining parts of a deep neural network was taking about 30 minutes per job on average. Given the potential for long running jobs, I wanted to provide status updates in real-time to the user to keep them informed of progress.

I also needed to analyze images using classifiers that had already been trained, which typically takes less than 100ms per job. I could not have these shorter jobs blocked by the longer running 30-minute ones.

An initial implementation looked something like this:
There are a number of problems here:

  1. The Google Compute Engine server is massively overloaded, handling several types of jobs.
  2. It was possible to create a Compute Engine auto-scaling pool of up to 10 instances depending on demand, but if 10 long-running training tasks were requested, then there wouldn’t be any instances available for classification or file upload tasks.
  3. Due to budget constraints for the project, I couldn’t fire up more than 10 instances at a time.


Database options
In addition to having to support many different kinds of workloads, this application required being able to store persistent data. There are a number of databases that support this, the most obvious of which is Google Cloud SQL. However, I had a number of issues with this approach:

  1. Time investment. Using Cloud SQL would have meant writing all that DB code to integrate with a SQL database myself, and I needed to provide a working prototype ASAP.
  2. Security. Cloud SQL integration would have required the Google Compute Engine instances to have direct access to the core database, which I did not want to expose.
  3. Heterogeneous jobs. It’s 2016 and surely there's something that solves this issue already that could work with different job types?

My solution was to use Firebase, Google’s backend as a service offering for creating mobile and web applications. Firebase allowed me to use their existing API to persist data using JSON objects (perfect for my Node.js based server), which allowed the client to listen to changes to DB (perfect for communicating status updates on jobs), and did not require tightly coupled integration with my core Cloud SQL database.

My Google Cloud Platform stack


I ended up splitting the server into three pools that were highly specialized for a specific task: one for classification, one for training, and one for file upload. Here are the cloud technologies I used for each task:

Firebase
I had been eyeing an opportunity to use Firebase on a project for quite some time after speaking with James Tamplin and his team. One key feature of Firebase is that it allows you to create a real-time database in minutes. That’s right, real time, with support for listening for updates to any part of it, just using JavaScript. And yes, you can write a working chat application in less than 5 minutes using Firebase! This would be perfect for real-time job status updates as I could just have the front-end listen for changes to the job in question and refresh the GUI. What’s more, all the websockets and DB fun is handled for you, so I just needed to pass JSON objects around using a super easy-to-use API  Firebase even handles going offline, syncing when connectivity is restored.

Cloud Pub/Sub
My colleagues Robert Kubis and Mete Atamel introduced me to Google Cloud Pub/Sub, Google’s managed real-time messaging service. Cloud Pub/Sub essentially allows you to send messages to a central topic from which your Compute Engine instances can create a subscription and pull/push from/to asynchronously in a loosely coupled manner. This guarantees that all jobs will eventually run, once capacity becomes available, and it all happens behind the scenes so you don't have to worry about retrying the job yourself. It’s a massive time-saver.
Any number of endpoints can be Cloud Pub/Sub publishers and pull subscribers
App Engine
This is where I hosted and delivered my front-end web application  all of the HTML, CSS, JavaScript and theme assets are stored here and scaled automatically on-demand. Even better, App Engine is a managed platform with built-in security and auto-scaling as you code against the App Engine APIs in your preferred language (Java, Python, PHP etc). The APIs also provide access to advanced functionality such as Memcache, Cloud SQL and more without having to worry about how to scale them as load increases.

Compute Engine with AutoScaling
Compute Engine is probably what most web devs are familiar with. It’s a server on which you can install your OS of choice and get full root access to that instance. The instances are fully customizable (you can configure how many vCPUs you desire, as well as RAM and storage) and are charged by the minute  for added cost savings when you scale up and down with demand. Clearly, having root access means you can do pretty much anything you could dream of on these machines, and this is where I chose to run my TensorFlow environment. Compute Engine also benefits from autoscaling, increasing and decreasing the number of available Compute Engine instances with demand or according to a custom metric. For my use case, I had an autoscaler ranging from 2 to 10 instances at any given time, depending on average CPU usage.

Cloud Storage
Google Cloud Storage is an inexpensive place in which you can store a large number of files (both in size and numbers) that are replicated to key edge server locations around the globe, closer to the requesting user. This is where I stored the uploaded files used to train the classifiers in my machine learning system until they were needed.


Network Load Balancer
My JavaScript application was making use of a webcam, and I therefore needed to access it over a secure connection (HTTPS). Google’s Network Load Balancer allows you to route traffic to the different Compute Engine clusters that you have defined. In my case, I had a cluster for classifying images, and a cluster for training new classifiers, and so depending on what was being requested, I could route that request to the right backend, all securely, via HTTPS.

Putting it all together


After putting all these components together, my system architecture looked roughly like this:
While this worked very well, some parts were redundant. I discovered that the Google Compute Engine Upload Pool code could be re-written to just run on App Engine in Java, pushing directly to Cloud Storage, thus taking out the need for an extra pool of Compute Engine instances. Woohoo!

In addition, now that I was using App Engine, the custom SSL load balancer was also redundant as App Engine itself could simply push new jobs to Pub/Sub internally, and deliver any front-end assets over HTTPS out of the box via appspot.com. Thus, the final architecture should look as follows if deploying on Google’s appspot.com:

Reducing the complexity of the architecture will make it easier to maintain, and add to cost savings.


Conclusion


By using Pub/Sub and Firebase, I estimate I saved well over a week’s development time, allowing me to jump in and solve the problem at hand in a short timeframe. Even better, the prototype scaled with demand, and ensured that all jobs would eventually be served even when at max capacity for budget.

Combining the Google Cloud Platform stack provides the web developer with a great toolkit for prototyping full end-to-end systems at rapid speed while aiding security and scalability for the future. I highly recommend you try them out for yourself.