Tải bản đầy đủ (.pdf) (403 trang)

Google cloud platform architects solutions 1 pdf

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (17.75 MB, 403 trang )


Google Cloud Platform for Architects

Design and manage powerful cloud solutions

Vitthal Srinivasan
Janani Ravi
Judy Raj


BIRMINGHAM - MUMBAI



Google Cloud Platform for Architects
Copyright © 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means,
without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the
information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its
dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the
appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Vijin Boricha
Acquisition Editor: Rohit Rajkumar
Content Development Editor: Abhishek Jadhav
Technical Editor: Mohd Riyan Khan
Copy Editors: Safis Editing, Dipti Mankame
Project Coordinator: Judie Jose
Proofreader: Safis Editing
Indexer: Priyanka Dhadke


Graphics: Tom Scaria
Production Coordinator: Shantanu Zagade
First published: June 2018
Production reference: 1220618
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78883-430-8
www.packtpub.com


mapt.io

Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as
industry leading tools to help you plan your personal development and advance your career. For more
information, please visit our website.


Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos from over
4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content


PacktPub.com

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files
available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you
are entitled to a discount on the eBook copy. Get in touch with us at for more
details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free
newsletters, and receive exclusive discounts and offers on Packt books and eBooks.


Contributors


About the authors
Vitthal Srinivasan is a Google Cloud Platform Authorized Trainer and certified Google Cloud
Architect and Data Engineer. Vitthal holds master's degrees in math and electrical engineering from
Stanford and an MBA from INSEAD. He has worked at Google as well as at other large firms, such
as Credit Suisse and Flipkart. He is currently in Loonycorn, a technical video content studio, of which
he is a cofounder.

Janani Ravi is a certified Google Cloud Architect and Data Engineer. She has earned her master's
degree in electrical engineering from Stanford. She is currently in Loonycorn, a technical video
content studio, of which she is a cofounder. Prior to co-founding Loonycorn, she worked at various
leading companies, such as Google and Microsoft, for several years as a software engineer.
I would like to thank my family, dogs, colleagues at Loonycorn, and friends for making life so much fun!

Judy Raj is a Google Certified Professional Cloud Architect, and she has great experience with the
three leading cloud platforms, namely AWS, Azure, and the GCP. She has also worked with a wide
range of technologies in machine learning, data science, IoT, robotics, and mobile and web app
development. She is currently a technical content engineer in Loonycorn. She holds a degree in
computer science and engineering from Cochin University of Science and Technology. Being a driven
engineer fascinated with technology, she is a passionate coder, an AI enthusiast, and a cloud

aficionado.
I'd like to thank my coauthors and colleagues for all the support and encouragement I've received. I'd also like to thank God
and my parents for everything that I am and everything I aspire to be.


About the reviewer
Tim Berry is a systems architect and software engineer with over 20 years of experience in building
enterprise infrastructure and systems on the internet and mobile platforms. He currently leads a team
of SREs building customer solutions on Google Cloud Platform for a managed services provider in
the UK. Tim is a Google Certified Professional Cloud Architect and Data Engineer, a Red Hat
Certified Engineer, and systems administrator. He holds Red Hat Certified Specialist status for
configuration management and containerized application development.
I would like to thank my wife, Sophie, for her patience and inspiration; my amazing kids, Josh, Ellie, Tommy, Isaac, and Noah
for making me laugh; and my parents for always supporting me. I'd also like to say hi to my dogs, Ruby, Lilo, and Belle, and
ask them to get down now please because I'm working.

Nisarg M. Vasavada is a content engineer in Loonycorn. He has pursued his master's in engineering
at GTU, and he has been an active member of technical education and research community with his
publications. He loves writing and believes that simplifying complexities is the biggest responsibility
of an author.
Being a part of this book's writing process was absolutely insightful. I would like to thank and dedicate this book to my family,
colleagues, and mentors for always looking after me. Also, lots of love and warmth to my feline and canine siblings!


Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today.
We have worked with thousands of developers and tech professionals, just like you, to help them
share their insight with the global tech community. You can make a general application, apply for a
specific hot topic that we are recruiting an author for, or submit your own idea.



Table of Contents
Title Page
Copyright and Credits
Google Cloud Platform for Architects
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the authors
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Conventions used
Get in touch
Reviews


1.

The Case for Cloud Computing
Genesis
Why Google Cloud Platform (GCP)?
Autoscaling and autohealing
Capital expenditure (CAPEX) versus operating expenses (OPEX)
Career implications
Summary



2.

Introduction to Google Cloud Platform
Global, regional, and zonal resources
Accessing the Google Cloud Platform
Projects and billing
Setting up a GCP account
Using the Cloud Shell
Summary


3.

Compute Choices – VMs and the Google Compute Engine
Google Compute Engine – GCE
Creating VMs
Creating a VM instance using the web console
Creating a VM instance using the command line
VM customization options
Operating system
Compute zone
Machine type
Networks – aka VPCs
Storage options
Persistent disks and local SSDs – block storage for GCE
Understanding persistent disks and local SSDs
Creating and attaching a persistent disk
Linux procedure for formatting and mounting a persistent disk

Sharing a persistent disk between multiple instances
Resizing a persistent disk
More on working with GCE VMs
Rightsizing recommendations
Availability policies
Auto-restart
Preemptibillity
Load balancing
Autoscaling and managed instance groups
Billing
Labels and tags
Startup scripts
Snapshots and images
How to snapshot a disk
How to create an image of a disk
Cloud launcher
Deploying LAMP stack using GCE
Modifying GCE VMs
Summary


4.

GKE, App Engine, and Cloud Functions
GKE
Contrasting containers and VMs
What is a container?
Docker containers and Kubernetes – complements, not substitutes
GKE
Creating a Kubernetes cluster and deploying a WordPress container

Using the features of GKE
Storage and persistent disks
Load balancing
Auto scaling
Scaling nodes with the cluster autoscaler
Scaling pods with the horizontal pod autoscaler
Multi-zone clusters
Cloud VPN integration
Rolling updates
The container registry
Federated clusters
Google App Engine – flexible
Hosted Docker containers with App Engine Flex
Running a simple Python application with App Engine Flex 
Cron Jobs with App Engine Flex
Advantages of GKE over Docker on VMs or App Engine Flex
Google App Engine – standard
Hosted web apps with App Engine Standard
Typical App Engine architecture
Deploying and running on App Engine Standard
Traffic splitting
Serverless compute with cloud functions
Cloud Functions triggered by HTTP
Cloud Functions triggered by Pub/Sub
Cloud functions triggered by GCS object notifications
Summary


5.


Google Cloud Storage – Fishing in a Bucket
Knowing when (and when not) to use GCS
Serving Static Content with GCS Buckets
Storage classes–Regional, multi-regional, nearline, and coldline
Working with GCS buckets
Creating buckets
Creating buckets using the web console
Creating buckets using gsutil
Changing the storage class of bucket and objects
Transferring data in and out of buckets
Uploading data to buckets using the web console
Uploading data to buckets using gsutil
Copying data between buckets using the web console
Copying data between buckets using the gsutil command line
Using the Transfer Service (instead of gsutil or the web console)
Transfer Service or gsutil?
Use case – Object Versioning
Object versioning in the Cloud Storage bucket
Use case – object life cycle policies
Managing bucket life cycle using the web console
Manipulating object life-cycle via JSON file
Deleting objects permanently using the web console
Deleting objects permanently using gsutil
Use case – restricting access with both ACLs and IAM
Managing permissions in bucket using the GCP console
Use case – signed and timed URLs
Setting up signed URLs for cloud storage
Use case – reacting to object changes
Setting up object change notifications with the gsutil notification watchbucket
Use case – using customer supplied encryption keys

Use case – auto-syncing folders
Use case – mounting GCS using gcsfuse
Mounting GCS buckets
Use case – offline ingestion options
Summary


6.

Relational Databases
Relational databases, SQL, and schemas
OLTP and the ACID properties
Scaling up versus scaling out
GCP Cloud SQL
Creating a Cloud SQL instance
Creating a database in a Cloud SQL instance
Importing a database
Testing Cloud SQL instances
Use case – managing replicas
Use case – managing certificates
Use case – operating Cloud SQL through VM instances
Automatic backup and restore
Cloud Spanner
Creating a Cloud Spanner instance
Creating a database in Cloud Spanner instances
Querying a database in a Cloud Spanner instance
Interleaving tables in Cloud Spanner
Summary



7.

NoSQL Databases
NoSQL databases
Cloud Bigtable
Fundamental properties of Bigtable
Columnar datastore
Denormalization
Support for ACID properties
Working with Bigtable
When to use Bigtable
Solving hot-spotting
Choosing storage for Bigtable
Solving performance issues
Ideal row key choices
Performing operations on Bigtable
Creating and operating an HBase table using Cloud Bigtable
Exporting/Importing a table from Cloud Bigtable
Scaling GCP Cloud BigTable
The Google Cloud Datastore
Comparison with traditional databases
Working with Datastore
When to use Datastore
Full indexing and perfect index
Using Datastore
Summary


8.


BigQuery
Underlying data representation of BigQuery
BigQuery public datasets
Legacy versus standard SQL
Working with the BigQuery console
Loading data into a table using BigQuery
Deleting datasets
Working with BigQuery using CLI
BigQuery pricing
Analyzing financial time series with BigQuery
Summary


9.

Identity and Access Management
Resource hierarchy of GCP
Permissions and roles
Units of identity in GCP
Creating a Service Account
Working with cloud IAM – grant a role
Working with IAM – creating a custom role
Summary


10.

Managing Hadoop with Dataproc
Hadoop and Spark
Hadoop on the cloud

Google Cloud Dataproc
Compute options for Dataproc
Working with Dataproc
Summary


11.

Load Balancing
Why load balancers matter now
Taxonomy of GCP load balancers
HTTP(S) load balancing
Configuring HTTP(S) load balancing
Configuring Internal Load Balancing
Other load balancing
Summary


12.

Networking in GCP
Why GCP's networking model is unique
VPC networks and subnets
The default VPC
Internal and external IP addresses
VPN and cloud router
Working with VPCs
Working with custom subnets
Working with firewall rules
Summary



×