Google Cloud Platform in Action
JJ Geewax
Foreword by Urs Hölzle, Google
  • August 2018
  • ISBN 9781617293528
  • 632 pages
  • printed in black & white

Demonstrates how to use GCP in practice while also explaining how things work under the hood.

From the Foreword by Urs Hölzle, SVP, Technical Infrastructure, Google

Google Cloud Platform in Action teaches you to build and launch applications that scale, leveraging the many services on GCP to move faster than ever. You'll learn how to choose exactly the services that best suit your needs, and you’ll be able to build applications that run on Google Cloud Platform and start more quickly, suffer fewer disasters, and require less maintenance.

Table of Contents detailed table of contents

Part 1: Getting started

1 What is “cloud”?

1.1 What is Google Cloud Platform?

1.2 Why cloud?

1.2.1 Why not cloud?

1.3 What to expect from cloud services

1.3.1 Computing

1.3.2 Storage

1.3.3 Analytics (aka, Big Data)

1.3.4 Networking

1.3.5 Pricing

1.4 Building an application for the cloud

1.4.1 What is a cloud application?

1.4.2 Example: serving photos

1.4.3 Example projects

1.5 Getting started with Google Cloud Platform

1.5.1 Signing up for GCP

1.5.2 Exploring the console

1.5.3 Understanding projects

1.5.4 Installing the SDK

1.6 Interacting with GCP

1.6.1 In the browser: the Cloud Console

1.6.2 On the command line: gcloud

1.6.3 In your own code: google-cloud-*

Summary

2 Trying it out: deploying WordPress on Google Cloud

2.1 System layout overview

2.2 Digging into the database

2.2.1 Turning on a Cloud SQL instance

2.2.2 Securing your Cloud SQL instance

2.2.3 Connecting to your Cloud SQL instance

2.2.4 Configuring your Cloud SQL instance for WordPress

2.3 Deploying the WordPress VM

2.4 Configuring WordPress

2.5 Reviewing the system

2.6 Turning it off

Summary

3 The cloud data center

3.1 Data center locations

3.2 Isolation levels and fault tolerance

3.2.1 Zones

3.2.2 Regions

3.2.3 Designing for fault tolerance

3.2.4 Automatic high availability

3.3 Safety concerns

3.3.1 Security

3.3.2 Privacy

3.3.3 Special cases

3.4 Resource isolation and performance

Summary

Part 2: Storage

4 Cloud SQL: managed relational storage

4.1 What’s Cloud SQL?

4.2 Interacting with Cloud SQL

4.3 Configuring Cloud SQL for production

4.3.1 Access control

4.3.2 Connecting over SSL

4.3.3 Maintenance windows

4.3.4 Extra MySQL options

4.4 Scaling up (and down)

4.4.1 Computing power

4.4.2 Storage

4.5 Replication

4.5.1 Replica-specific operations

4.6 Backup and restore

4.6.1 Automated daily backups

4.6.2 Manual data export to Cloud Storage

4.7 Understanding pricing

4.8 When should I use Cloud SQL?

4.8.1 Structure

4.8.2 Query complexity

4.8.3 Durability

4.8.4 Speed (latency)

4.8.5 Throughput

4.9 Cost

4.9.1 Overall

4.10 Weighing Cloud SQL against a VM running MySQL

Summary

5 Cloud Datastore: document storage

5.1 What’s Cloud Datastore?

5.1.1 Design goals for Cloud Datastore

5.1.2 Concepts

5.1.3 Consistency and replication

5.1.4 Consistency with data locality

5.2 Interacting with Cloud Datastore

5.3 Backup and restore

5.4 Understanding pricing

5.4.1 Storage costs

5.4.2 Per-operation costs

5.5 When should I use Cloud Datastore?

5.5.1 Structure

5.5.2 Query complexity

5.5.3 Durability

5.5.4 Speed (latency)

5.5.5 Throughput

5.5.6 Cost

5.5.7 Overall

5.5.8 Other document storage systems

Summary

6 Cloud Spanner: large-scale SQL

6.1 What is NewSQL?

6.2 What is Spanner?

6.3 Concepts

6.3.1 Instances

6.3.2 Nodes

6.3.3 Databases

6.3.4 Tables

6.4 Interacting with Cloud Spanner

6.4.1 Creating an instance and database

6.4.2 Creating a table

6.4.3 Adding data

6.4.4 Querying data

6.4.5 Altering database schema

6.5 Advanced concepts

6.5.1 Interleaved tables

6.5.2 Primary keys

6.5.3 Split points

6.5.4 Choosing primary keys

6.5.5 Secondary indexes

6.5.6 Transactions

6.6 Understanding pricing

6.7 When should I use Cloud Spanner?

6.7.1 Structure

6.7.2 Query complexity

6.7.3 Durability

6.7.4 Speed (latency)

6.7.5 Throughput

6.7.6 Cost

6.7.7 Overall

Summary

7 Cloud Bigtable: large-scale structured data

7.1 What is Bigtable?

7.1.1 Design goals

7.1.2 Design nongoals

7.1.3 Design overview

7.2 Concepts

7.2.1 Data model concepts

7.2.2 Infrastructure concepts

7.3 Interacting with Cloud Bigtable

7.3.1 Creating a Bigtable Instance

7.3.2 Creating your schema

7.3.3 Managing your data

7.3.4 Importing and exporting data

7.4 Understanding pricing

7.5 When should I use Cloud Bigtable?

7.5.1 Structure

7.5.2 Query complexity

7.5.3 Durability

7.5.4 Speed (latency)

7.5.5 Throughput

7.5.6 Cost

7.5.7 Overall

7.6 What’s the difference between Bigtable and HBase?

7.7 Case study: InstaSnap recommendations

7.7.1 Querying needs

7.7.2 Tables

7.7.3 Users table

7.7.4 Recommendations table

7.7.5 Processing data

Summary

8 Cloud Storage: object storage

8.1 Concepts

8.1.1 Buckets and objects

8.2 Storing data in Cloud Storage

8.3 Choosing the right storage class

8.3.1 Multiregional storage

8.3.2 Regional storage

8.3.3 Nearline storage

8.3.4 Coldline storage

8.4 Access control

8.4.1 Limiting access with ACLs

8.4.2 Signed URLs

8.4.3 Logging access to your data

8.5 Object versions

8.6 Object lifecycles

8.7 Change notifications

8.7.1 URL restrictions

8.8 Common use cases

8.9 Understanding pricing

8.9.1 Amount of data stored

8.9.2 Amount of data transferred

8.9.3 Number of operations executed

8.9.4 Nearline and Coldline pricing

8.10 When should I use Cloud Storage?

8.10.1 Structure

8.10.2 Query complexity

8.10.3 Durability

8.10.4 Speed (latency)

8.10.5 Throughput

8.10.6 Overall

8.10.7 To-do list

8.10.8 E*Exchange

8.10.9 InstaSnap

Summary

Part 3: Computing

9 Compute Engine: virtual machines

9.1 Launching your first (or second) VM

9.2 Block storage with Persistent Disks

9.2.1 Disks as resources

9.2.2 Attaching and detaching disks

9.2.3 Using your disks

9.2.4 Resizing disks

9.2.5 Snapshots

9.2.6 Images

9.2.7 Performance

9.2.8 Encryption

9.3 Instance groups and dynamic resources

9.3.1 Changing the size of an instance group

9.3.2 Rolling updates

9.3.3 Autoscaling

9.4 Ephemeral computing with preemptible VMs

9.4.1 Why use preemptible machines?

9.4.2 Turning on preemptible VMs

9.4.3 Handling terminations

9.4.4 Preemption selection

9.5 Load balancing

9.5.1 Backend configuration

9.5.2 Host and path rules

9.5.3 Frontend configuration

9.5.4 Reviewing the configuration

9.6 Cloud CDN

9.6.1 Enabling Cloud CDN

9.6.2 Cache control

9.7 Understanding pricing

9.7.1 Computing capacity

9.7.2 Sustained use discounts

9.7.3 Preemptible prices

9.7.4 Storage

9.7.5 Network traffic

9.8 When should I use GCE?

9.8.1 Flexibility

9.8.2 Complexity

9.8.3 Performance

9.8.4 Cost

9.8.5 Overall

9.8.6 To-Do List

9.8.7 E*Exchange

9.8.8 InstaSnap

Summary

10 Kubernetes Engine: managed Kubernetes clusters

10.1 What are containers?

10.1.1 Configuration

10.1.2 Standardization

10.1.3 Isolation

10.2 What is Docker?

10.3 What is Kubernetes?

10.3.1 Clusters

10.3.2 Nodes

10.3.3 Pods

10.3.4 Services

10.4 What is Kubernetes Engine?

10.5 Interacting with Kubernetes Engine

10.5.1 Defining your application

10.5.2 Running your container locally

10.5.3 Deploying to your container registry

10.5.4 Setting up your Kubernetes Engine cluster

10.5.5 Deploying your application

10.5.6 Replicating your application

10.5.7 Using the Kubernetes UI

10.6 Maintaining your cluster

10.6.1 Upgrading the Kubernetes master node

10.6.2 Upgrading cluster nodes

10.6.3 Resizing your cluster

10.7 Understanding pricing

10.8 When should I use Kubernetes Engine?

10.8.1 Flexibility

10.8.2 Complexity

10.8.3 Performance

10.8.4 Cost

10.8.5 Overall

10.8.6 To-Do List

10.8.7 E*Exchange

10.8.8 InstaSnap

Summary

11 App Engine: fully managed applications

11.1 Concepts

11.1.1 Applications

11.1.2 Services

11.1.3 Versions

11.1.4 Instances

11.2 Interacting with App Engine

11.2.1 Building an application in App Engine Standard

11.2.2 On App Engine Flex

11.3 Scaling your application

11.3.1 Scaling on App Engine Standard

11.3.2 Scaling on App Engine Flex

11.3.3 Choosing instance configurations

11.4 Using App Engine Standard’s managed services

11.4.1 Storing data with Cloud Datastore

11.4.2 Caching ephemeral data

11.4.3 Deferring tasks

11.4.4 Splitting traffic

11.5 Understanding pricing

11.6 When should I use App Engine?

11.6.1 Flexibility

11.6.2 Complexity

11.6.3 Performance

11.6.4 Cost

11.6.5 Overall

11.6.6 To-Do List

11.6.7 E*Exchange

11.6.8 InstaSnap

Summary

12 Cloud Functions: serverless applications

12.1 What are microservices?

12.2 What is Google Cloud Functions?

12.2.1 Concepts

12.3 Interacting with Cloud Functions

12.3.1 Creating a function

12.3.2 Deploying a function

12.3.3 Triggering a function

12.4 Advanced concepts

12.4.1 Updating functions

12.4.2 Deleting functions

12.4.3 Using dependencies

12.4.4 Calling other Cloud APIs

12.4.5 Using a Google Source Repository

12.5 Understanding pricing

Summary

13 Cloud DNS: managed DNS hosting

13.1 What is Cloud DNS?

13.1.1 Example DNS entries

13.2 Interacting with Cloud DNS

13.2.1 Using the Cloud Console

13.2.2 Using the Node.js client

13.3 Understanding pricing

13.3.1 Personal DNS hosting

13.3.2 Startup business DNS hosting

13.4 Case study: giving machines DNS names at boot

Summary

Part 4: Machine learning

14 Cloud Vision: image recognition

14.1 Annotating images

14.1.1 Label annotations

14.1.2 Faces

14.1.3 Text recognition

14.1.4 Logo recognition

14.1.5 Safe-for-work detection

14.1.6 Combining multiple detection types

14.2 Understanding pricing

14.3 Case study: enforcing valid profile photos

Summary

15 Cloud Natural Language: text analysis

15.1 How does the Natural Language API work?

15.2 Sentiment analysis

15.3 Entity recognition

15.4 Syntax analysis

15.5 Understanding pricing

15.6 Case study: suggesting InstaSnap hash-tags

Summary

16 Cloud Speech: audio-to-text conversion

16.1 Simple speech recognition

16.2 Continuous speech recognition

16.3 Hinting with custom words and phrases

16.4 Understanding pricing

16.5 Case study: InstaSnap video captions

Summary

17 Cloud Translation: multilanguage machine translation

17.1 How does the Translation API work?

17.2 Language detection

17.3 Text translation

17.4 Understanding pricing

17.5 Case study: translating InstaSnap captions

Summary

18 Cloud Machine Learning Engine: managed machine learning

18.1 What is machine learning?

18.1.1 What are neural networks?

18.1.2 What is TensorFlow?

18.2 What is Cloud Machine Learning Engine?

18.2.1 Concepts

18.2.2 Putting it all together

18.3 Interacting with Cloud ML Engine

18.3.1 Overview of US Census data

18.3.2 Creating a model

18.3.3 Setting up Cloud Storage

18.3.4 Training your model

18.3.5 Making predictions

18.3.6 Configuring your underlying resources

18.4 Understanding pricing

18.4.1 Training costs

18.4.2 Prediction costs

Summary

Part 5: Data processing and analytics

19 BigQuery: highly scalable data warehouse

19.1 What is BigQuery?

19.1.1 Why BigQuery?

19.1.2 How does BigQuery work?

19.1.3 Concepts

19.2 Interacting with BigQuery

19.2.1 Querying data

19.2.2 Loading data

19.2.3 Exporting datasets

19.3 Understanding pricing

19.3.1 Storage pricing

19.3.2 Data manipulation pricing

19.3.3 Query pricing

Summary

20 Cloud Dataflow: large-scale data processing

20.1 What is Apache Beam?

20.1.1 Concepts

20.1.2 Putting it all together

20.2 What is Cloud Dataflow?

20.3 Interacting with Cloud Dataflow

20.3.1 Setting up

20.3.2 Creating a pipeline

20.3.3 Executing a pipeline locally

20.3.4 Executing a pipeline using Cloud Dataflow

20.4 Understanding pricing

Summary

21 Cloud Pub/Sub: managed event publishing

21.1 The headache of messaging

21.2 What is Cloud Pub/Sub?

21.3 Life of a message

21.4 Concepts

21.4.1 Topics

21.4.2 Messages

21.4.3 Subscriptions

21.4.4 Sample configuration

21.5 Trying it out

21.5.1 Sending your first message

21.5.2 Receiving your first message

21.6 Push subscriptions

21.7 Understanding pricing

21.8 Messaging patterns

21.8.1 Fan-out broadcast messaging

21.8.2 Work-queue messaging

Summary

About the Technology

Thousands of developers worldwide trust Google Cloud Platform, and for good reason. With GCP, you can host your applications on the same infrastructure that powers Search, Maps, and the other Google tools you use daily. You get rock-solid reliability, an incredible array of prebuilt services, and a cost-effective, pay-only-for-what-you-use model. This book gets you started.

About the book

Google Cloud Platform in Action teaches you how to deploy scalable cloud applications on GCP. Author and Google software engineer JJ Geewax is your guide as you try everything from hosting a simple WordPress web app to commanding cloud-based AI services for computer vision and natural language processing. Along the way, you’ll discover how to maximize cloud-based data storage, roll out serverless applications with Cloud Functions, and manage containers with Kubernetes. Broad, deep, and complete, this authoritative book has everything you need.

What's inside

  • The many varieties of cloud storage and computing
  • How to make cost-effective choices
  • Hands-on code examples
  • Cloud-based machine learning

About the reader

Written for intermediate developers. No prior cloud or GCP experience required.

About the author

JJ Geewax is a software engineer at Google, focusing on Google Cloud Platform and API design.


Read what our manuscript reviewers are saying

FREE domestic shipping on three or more pBooks

Provides powerful insight into Google Cloud, with great worked examples.

Max Hemingway, DXC Technology

A great asset when migrating to Google Cloud, not only for developers, but for architects and management too.

Michał Ambroziewicz, Netsprint

As an Azure user, I got great insights into Google Cloud and a comparison of both providers. A must-read.

Grzegorz Bernas, Antaris Consulting