You are previewing Building Your Next Big Thing with Google Cloud Platform: A Guide for Developers and Enterprise Architects.
O'Reilly logo
Building Your Next Big Thing with Google Cloud Platform: A Guide for Developers and Enterprise Architects

Book Description

Google is known for the scalability, reliability, and efficiency of its various online products, from Google Search to Gmail. And, the results are impressive. Google Search, for example, returns results literally within fractions of second. How is this possible? Google custom-builds both hardware and software, including servers, switches, networks, data centers, the operating system’s stack, application frameworks, applications, and APIs.

Have you ever imagined what you could build if you were able to tap the same infrastructure that Google uses to create and manage its products?

Now you can! Building Your Next Big Thing with Google Cloud Platform shows you how to take advantage of the Google Cloud Platform technologies to build all kinds of cloud-hosted software and services for both public and private consumption. Whether you need a simple virtual server to run your legacy application or you need to architect a sophisticated high-traffic web application, Cloud Platform provides all the tools and products required to create innovative applications and a robust infrastructure to manage them.

Using this book as your compass, you can navigate your way through the Google Cloud Platform and turn your ideas into reality. The authors, both Google Developer Experts in Google Cloud Platform, systematically introduce various Cloud Platform products one at a time and discuss their strengths and scenarios where they are a suitable fit. But rather than a manual-like "tell all" approach, the emphasis is on how to Get Things Done so that you get up to speed with Google Cloud Platform as quickly as possible. You will learn how to use the following technologies, among others:

• Google Compute Engine

• Google App Engine

• Google Container Engine

• Google App Engine Managed VMs

• Google Cloud SQL

• Google Cloud Storage

• Google Cloud Datastore

• Google BigQuery

• Google Cloud Dataflow

• Google Cloud DNS

• Google Cloud Pub/Sub

• Google Cloud Endpoints

• Google Cloud Deployment Manager

• Author on Google Cloud Platform

• Google APIs and Translate API

Using real-world examples, the authors first walk you through the basics of cloud computing, cloud terminologies and public cloud services. Then they dive right into Google Cloud Platform and how you can use it to tackle your challenges, build new products, analyze big data, and much more. Whether you’re an independent developer, startup, or Fortune 500 company, you have never had easier to access to world-class production, product development, and infrastructure tools. Google Cloud Platform is your ticket to leveraging your skills and knowledge into making reliable, scalable, and efficient products—just like how Google builds its own products.

Table of Contents

  1. Cover
  2. Title
  3. Copyright
  4. Dedication
  5. Contents at a Glance
  6. Contents
  7. About the Authors
  8. Acknowledgments
  9. Introduction
  10. Part I: Introducing Cloud Computing and Google Cloud Platform
    1. Chapter 1: The Google Cloud Platform Difference
      1. What Is Cloud Computing?
      2. Technical Benefits of Using a Public Cloud
        1. Uptime
        2. Resource Utilization
        3. Expertise
      3. Economic Benefits of Using a Public Cloud
        1. TCO
        2. Economies of Scale
        3. CapEx and OpEx
        4. ROI and Profit Margins
      4. Business Benefits of Using a Public Cloud
        1. Time to Market
        2. Self-Service
        3. Pay per Use
        4. Uncertain Growth Patterns
      5. Why Google Cloud Platform?
        1. Hardware Innovations
        2. Software Innovations
        3. Economic Innovations
      6. A Quick Comparison to AWS
      7. Summary
    2. Chapter 2: Getting Started with Google Cloud Platform
      1. Cloud Platform Building Blocks
        1. Projects
        2. Regions, Zones, Resources, and Quotas
      2. The Developers Console
        1. Permissions and Auth
      3. The Cloud SDK and the gcloud Tool
      4. APIs and Cloud Client Libraries
      5. Cloud Platform Products
      6. Summary
    3. Chapter 3: Using Google APIs
      1. Auth Essentials
        1. API Keys
        2. OAuth 2.0
      2. Translate API
        1. Accessing Translate REST API
        2. Discovering Languages Supported by Translate API
        3. Accessing Translate API using Client Programs
      3. Summary
  11. Part II: Google Cloud Platform - Compute Products
    1. Chapter 4: Google Compute Engine
      1. Virtual Machines
      2. Persistent Disks
      3. Networks and Firewalls
      4. Deploying High-Performance Virtual Machines Using Compute Engine
        1. Associating the gcloud Command-Line Tool with a Google Account
        2. Selecting a Google Cloud Platform Project
        3. Creating and Starting an Instance
        4. Allowing Ingress Network Access
      5. Creating a Web Presence with Compute Engine in 8 Minutes Flat
      6. Handling Unpredictable Traffic with the Compute Engine Load Balancer
        1. Forwarding Rules
        2. Target Pool
        3. Load-Distribution Algorithm
        4. Health Checks
        5. Going Live
      7. Building a Global Multi-Datacenter Web Tier in an Hour
        1. Global Forwarding Rules
        2. Target HTTP Proxy
        3. URL Maps
        4. Backend Services
        5. Instance Groups
        6. Load-Distribution Algorithm
        7. Going Live
      8. Automatically Resizing a Web Tier with the Compute Engine Autoscaler
        1. Managed Instance Group
        2. Utilization Metric
        3. Target Utilization Level
        4. Autoscaling Integrations
        5. Going Live
      9. Summary
    2. Chapter 5: Google App Engine
      1. The SDK
      2. About Web Applications
      3. Time for the Much-Beloved “Hello World”
      4. Pretty “Hello World”
      5. Storing Information
      6. Key Properties and Ancestor Paths
        1. Batching and Asynchronous Operations
        2. Request Routing
        3. Queries
        4. Transactions
      7. User Management
      8. Memcache
      9. E-mail
      10. Task Queues
        1. Push Queues
        2. Pull Queues
        3. Handling Tasks
        4. Task Queues in the Administration Console
        5. Deleting Tasks
        6. Deferred Tasks
      11. Scheduled Tasks
        1. Schedule Format
        2. Updating Cron Information
      12. Logs
      13. Deploying
      14. Summary
    3. Chapter 6: Next Generation DevOps Initiatives
      1. Containers
        1. Operating System–Level Virtualization
        2. LXC and Control Groups
        3. Namespaces
      2. Docker
        1. Docker Images
        2. Docker Containers
      3. Kubernetes
        1. Pods
        2. Replication Controllers
        3. Volumes
        4. Labels and Annotations
        5. Networking
        6. Services
        7. Namespace
        8. DNS
      4. Google Container Engine
      5. App Engine Managed Virtual Machines
        1. Getting Started
        2. Deploying Docker Containers
        3. Live Debugging
        4. Configuring a Managed VM
      6. Summary
  12. Part III: Google Cloud Platform - Storage Products
    1. Chapter 7: Google Cloud SQL
      1. Building a Reliable MySQL Back End with Cloud SQL
        1. Creating a Cloud SQL Instance
        2. Setting Up Access to Cloud SQL Instance
        3. Connecting to your Cloud SQL Instance
        4. Securing Access to your Cloud SQL Instance
      2. Building a Scalable MySQL Cluster with Cloud SQL
        1. Step 1: Checking and Enabling (If Required) Database Backups
        2. Step 2: Checking and Enabling (If Required) Binary Logs in the Master Instance
        3. Step 3: Waiting for a Database Backup to Be Available
        4. Step 4: Creating a Cloud SQL Read Replica
        5. Setting Up WordPress CMS with Cloud SQL as Backend
      3. Expanding the Cloud SQL MySQL Cluster with External Nodes
        1. Setting Up a MySQL Server External to Cloud Platform
      4. Measuring the Performance of Cloud SQL
      5. Summary
    2. Chapter 8: Cloud Storage
      1. Your First File Upload
        1. Installing gsutil
        2. Enabling Cloud Storage
        3. Enabling Billing
        4. Authorizing Your Google Account at the Command Line
        5. Running Commands with gsutil
        6. Creating a New Bucket
        7. Uploading Your First File
        8. Cleaning Up
      2. Why Use Cloud Storage?
        1. Strong Consistency in Cloud Storage
        2. Applications of Cloud Storage
      3. Access Control
      4. Resumable Uploads
      5. Signed URLs
        1. URL Structure
        2. Signature
      6. Handling Errors
      7. ACLs (Access Control Lists)
        1. Permissions and Scopes
        2. Default and Predefined ACLs
      8. Lifecycle Management
      9. Automation
      10. Summary
    3. Chapter 9: Google Cloud Datastore
      1. Why Is Cloud Datastore Scalable?
      2. Why Is Cloud Datastore Highly Available?
      3. Why Is Cloud Datastore Fast?
      4. The Building Blocks of Cloud Datastore
        1. Properties
        2. Identifiers, Keys, and Ancestor Paths
        3. Cross-Group Transactions
      5. Cloud Datastore Indexes
        1. Exploding Indexes
      6. Queries
        1. Operating with Large datasets: OFFSET, LIMIT, and Cursors
        2. Filtering
        3. Optimizing for Costs: Keys-Only and Projection Queries
        4. Sorting
      7. Pricing
      8. Summary
  13. Part IV: Google Cloud Platform - Big Data Products
    1. Chapter 10: Google BigQuery
      1. Building Blocks and Fundamentals
      2. Importing Data
        1. Transform Apache Access Log Files
        2. Loading Transformed Data to BigQuery via Cloud Storage
      3. Querying Data
      4. Exporting Data and Creating Views
      5. Summary
    2. Chapter 11: Google Cloud Dataflow
      1. Setup
      2. The Building Blocks of Cloud Dataflow
        1. Pipelines
        2. PCollection
        3. Transforms
        4. Data Sources and Sinks
      3. Constructing and Executing Jobs in Cloud Dataflow
        1. 1. Filter Log to Extract Response Code
        2. 2. Count Occurrences for Each Response Code Found
        3. 3. Get the Top Five Response Codes
        4. 4. Format Response Codes and Counts into a Printable String
        5. Executing your pipeline
        6. Showing Results
      4. Summary
    3. Chapter 12: Google Cloud Pub/Sub
      1. Setting Up Your System
      2. Topics
      3. Subscriptions
        1. Push Subscriptions
        2. Pull Subscriptions
        3. Acknowledgement Deadline
      4. Messages
      5. Processing Messages
        1. Pull Subscriptions
        2. Push Subscriptions
      6. Summary
  14. Part V: Google Cloud Platform - Networking and Services
    1. Chapter 13: Google Cloud DNS
      1. Publishing Your Internet Identity
      2. Summary
    2. Chapter 14: Google Cloud Endpoints
      1. Cloud Endpoints and ProtoRPC
      2. Setting Up Your Environment: The SDK
      3. The Foundations of Your Application: app.yaml
      4. Your API and api_server
      5. The model: A Bridge between NDB Datastore and Cloud Endpoints
      6. Services and Request Handlers
        1. EndpointsModel.method
        2. EndpointsModel.query_method
      7. The APIs Explorer
      8. Generating Client Libraries for Your Application
        1. Accessing Your API from Your Android client
      9. Summary
  15. Part VI: Google Cloud Platform - Management and Recipes
    1. Chapter 15: Cloud Platform DevOps Toolbox
      1. Google Cloud Deployment Manager
        1. Building Blocks
        2. Launching the Compute Engine VM using Deployment Manager
        3. Developing Configuration and Template Files
        4. Managing Deployments
      2. Source and Binary Code Management
        1. Cloud Repositories
        2. Push-to-Deploy
        3. Source Code Tools
        4. Google Container Registry
      3. Hosted Security Services
        1. Cloud Debugger
        2. Cloud Security Scanner
        3. Cloud Trace
      4. Summary
    2. Chapter 16: Architecture Recipes for Google Cloud Platform
      1. Use Case 1: Using an Unmanaged Infrastructure to Host Internet-Scale Web Apps
        1. Think Big, Start Small, Scale Fast
      2. Use Case 2: Using Managed Infrastructure to Host Internet-Scale Web Apps
        1. Architecture 1: Autoscaling Web Apps with Google Container Engine
      3. Use Case 3: Doing Big Data Analytics, Google Style
      4. Use Case 4: The MVP Approach
      5. Use Case 5: LunchMates—Getting the World to Learn During Lunch
      6. What’s Next in Google Cloud Platform
        1. Google Compute Engine
        2. Google App Engine
        3. Google Container Engine
        4. Google Cloud SQL
        5. Google Cloud Storage
        6. Google Cloud DNS
      7. Summary
  16. Index