0%

Discover how Google Cloud services can help you to reduce operational tasks and focus on delivering business value with your applications

Key Features

  • Design, develop, and deploy end-to-end cloud-native applications using Google Cloud services
  • Prepare for the GCP developer exam with the help of a fictitious business case and a Q&A section
  • Get hands-on with implementing code examples of different GCP services in your applications

Book Description

Google Cloud Platform is one of the three major cloud providers in the industry, exhibiting great leadership in application modernization and data management. This book provides a comprehensive introduction for those who are new to cloud development and shows you how to use the tools to create cloud-native applications by integrating the technologies used by Google.

The book starts by taking you through the basic programming concepts and security fundamentals necessary for developing in Google Cloud. You'll then discover best practices for developing and deploying applications in the cloud using different components offered by Google Cloud Platform such as Cloud Functions, Google App Engine, Cloud Run, and other GCP technologies. As you advance, you'll learn the basics of cloud storage and choosing the best options for storing different kinds of data as well as understand what site reliability engineers do. In the last part, you'll work on a sample case study of Hip Local, a community application designed to facilitate communication between people nearby, created by the Google Cloud team.

By the end of this guide, you'll have learned how to design, develop, and deploy an end-to-end application on the Google Cloud Platform.

What you will learn

  • Get to grips with the fundamentals of Google Cloud Platform development
  • Discover security best practices for applications in the cloud
  • Find ways to create and modernize legacy applications
  • Understand how to manage data and databases in Google Cloud
  • Explore best practices for site reliability engineering, monitoring, logging, and debugging
  • Become well-versed with the practical implementation of GCP with the help of a case study

Who this book is for

This book is for cloud engineers or developers working or starting to work on Google Cloud Platform and looking to take advantage of cloud-native applications. You'll also find this book useful if you are preparing for the GCP developer exam.

Table of Contents

  1. Google Cloud Certified Professional Cloud Developer Exam Guide
  2. Contributors
  3. About the author
  4. About the reviewer
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Share Your Thoughts
  6. Section 1: Welcome to the Google Cloud Developers' Guide
  7. Chapter 1: Google Cloud Platform Developer Fundamentals
    1. Technical requirements
    2. The basics that every developer should know about Google Cloud infrastructure
    3. Regions and zones
    4. What is X as a Service?
    5. How to reduce latency to your end users
    6. Graceful shutdowns
    7. Top tips for developing and implementing resilient and scalable applications
    8. Microservice ecosystems
    9. Handling user sessions and the importance of stateless applications in the autoscaling world
    10. Application logging, your best friend in error troubleshooting
    11. Why should your microservices handle retries?
    12. How to handle high traffic with autoscaling
    13. Avoiding overload caching your data
    14. Loosely coupled microservices with topics
    15. Don't waste your time – use cloud management services and securely run your applications
    16. Don't reinvent the wheel
    17. Accessing services in a secure way
    18. Summary
  8. Chapter 2: Security Fundamentals and Best Practices
    1. Technical requirements
    2. Reducing the attack surface with POLP
    3. POLP
    4. How to authenticate client-to-service and service-to-service solutions
    5. IAM
    6. IAM hierarchy
    7. Service accounts
    8. Authenticating with Google services
    9. OAuth 2.0
    10. Identity-Aware Proxy
    11. Managing secrets with Google Secret Manager
    12. How to store your sensitive data in a secure way
    13. Google Secret Manager
    14. Cloud Key Management Service
    15. Google Cloud best practices
    16. POLP and roles
    17. Create one service account per microservice
    18. Avoid using Owner, Editor, and Viewer roles
    19. allUsers versus allAuthenticatedUsers
    20. Understand how the IAM hierarchy works
    21. Use Google management keys whenever possible
    22. Use OAuth 2.0 instead of sharing credentials between applications
    23. Use IAP when possible to authenticate and authorize users inside your organization
    24. Always use a key vault for the storage of secrets
    25. Summary
  9. Section 2: Developing and Modernizing Applications on Google Cloud Platform
  10. Chapter 3: Application Modernization Using Google Cloud
    1. Technical requirements
    2. Preparing your environment for developing applications on Google Cloud
    3. Emulating Google Cloud services for local application development
    4. Creating Google Cloud projects
    5. Using the command-line interface withCloud SDK
    6. Using developer tooling
    7. Be sure that your application will work fine on the cloud with testing
    8. Unit testing
    9. Integration testing
    10. End-to-end testing
    11. Load testing
    12. Improving your delivery speed with continuous integration and delivery pipelines
    13. Source control management
    14. Creating secure container images from code
    15. Application modernization best practices
    16. Modern application design
    17. Refactoring a monolith to microservices
    18. Summary
  11. Chapter 4: Using Cloud Functions and Google App Engine
    1. Technical requirements
    2. Welcome to serverless applications
    3. What is serverless?
    4. Advantages and disadvantages of serverless applications
    5. Event-based applications
    6. What is Google App Engine?
    7. Introducing Google Cloud Functions
    8. Different flavors for different situations
    9. HTTP functions
    10. Background functions
    11. Triggering cloud functions from Cloud Storage
    12. Triggering cloud functions from Pub/Sub
    13. Triggering cloud functions from Firestore
    14. Terminating HTTP functions
    15. Terminating background cloud functions
    16. App Engine standard environment
    17. App Engine flexible environment
    18. Exposing your services to the internet
    19. Google App Engine invoked via HTTP
    20. Cloud functions invoked via HTTP
    21. Deployment and security considerations
    22. Location considerations
    23. Securing cloud functions
    24. Securing App Engine
    25. How to make a canary release strategy with A/B testing
    26. Static versus dynamic data considerations
    27. Using traffic splitting in App Engine
    28. Summary
  12. Chapter 5: Virtual Machines and Container Applications on Google Cloud Platform
    1. Technical requirements
    2. Introduction to Docker and Kubernetes
    3. What is Docker?
    4. What are containers and Docker container images?
    5. What is Kubernetes?
    6. Clusters, nodes, and pods in Kubernetes
    7. How to use virtual machines on GCP
    8. Google Compute Engine fundamentals
    9. Managing service accounts for VMs
    10. Bootstrapping applications
    11. Managing Compute Engine VM images
    12. Reading instance metadata to obtain application configuration
    13. Forgetting the complexity of managing a Kubernetes cluster with GKE and Cloud Run
    14. GKE fundamentals
    15. Cloud Run fundamentals
    16. Configuring Kubernetes namespaces
    17. Pod life cycle and resource configuration
    18. Managing Kubernetes RBAC and Google Cloud IAM relationships
    19. The full deployment life cycle of an application on Google Compute Engine
    20. Installing an application in a virtual machine
    21. Creating an instance template
    22. Creating a managed instance group
    23. Configuring a load balancer
    24. Hands-on tutorials in Google Compute Engine
    25. The full deployment life cycle of an application on Google Kubernetes Engine and Cloud Run
    26. Building a container image using Cloud Build
    27. Defining workload specifications
    28. Deploying a containerized application to GKE
    29. Deploying a containerized application to Cloud Run
    30. Hands-on tutorials in Cloud Run
    31. Summary
  13. Chapter 6: Managing APIs on Google Cloud Platform
    1. Technical requirements
    2. The basics before implementing an API management solution in Google Cloud
    3. APIs
    4. API management
    5. The most common authentication methods
    6. OpenAPI Specification
    7. Swagger UI
    8. Swagger Editor
    9. How to protect your APIs using Cloud Endpoints on your deployments
    10. ESP implementation for Cloud Endpoints
    11. OpenAPI configuration for Cloud Endpoints
    12. Discovering the enterprise API management world with Apigee
    13. Deploying a serverless API using Cloud Functions
    14. Implementing an API management solution with Apigee
    15. Adding policies
    16. Creating an API product
    17. Creating a developer app
    18. Securing and managing your serverless workloads with the new Cloud API Gateway
    19. Deploying a serverless API using Cloud Functions
    20. Creating an API in API Gateway
    21. Exposing our service
    22. Protecting our services
    23. API development best practices
    24. An overview of DDD
    25. REST
    26. Summary
  14. Section 3: Storage Foundations
  15. Chapter 7: Handling Unstructured Data
    1. Technical requirements
    2. Different real-world use cases for cloud storage
    3. Worldwide delivery
    4. Analytics
    5. Backup
    6. Disaster recovery
    7. Audit
    8. Optimizing costs regarding storage use cases
    9. How to reduce costs using different tiers
    10. Standard
    11. Nearline
    12. Coldline
    13. Archive
    14. Explaining storage pricing
    15. Cloud storage summary diagrams
    16. Backing up and deleting files automatically
    17. Managing life cycles
    18. Rule conditions
    19. Implementing object life cycles
    20. Object versioning
    21. Bucket retention policy
    22. Object hold protection
    23. Protecting my data with security best practices
    24. Access control
    25. Data encryption
    26. Signed URLs
    27. Integrating cloud storage with my application
    28. Storing and retrieving objects from cloud storage
    29. How to avoid CORS problems
    30. Summary
  16. Chapter 8: Databases and Event Messages in Google Cloud
    1. Technical requirements
    2. First steps in the Cloud SQL and NoSQL world with Firestore
    3. What is Cloud SQL?
    4. Firestore
    5. Differences in designing and integrating a SQL database versus a NoSQL database in your application
    6. SQL versus NoSQL databases
    7. Which database is better for my workload?
    8. Traditional schema versus semi-structured database in Firestore
    9. Understanding how to connect to a Cloud SQL instance and the Firestore dashboard
    10. Creating and connecting to a Cloud SQL instance
    11. Configuring a Firestore instance and viewing the Firestore dashboard
    12. Decoupling applications using Pub/Sub
    13. Pub/Sub types
    14. Pub/Sub
    15. Pub/Sub Lite
    16. Relationship options
    17. Publishing a message
    18. Consuming a message using pull and push subscriptions
    19. Creating, updating, and showing data in your frontend application
    20. Firestore dependencies
    21. Creating a document
    22. Updating a document
    23. Transactions
    24. Batch writes
    25. Getting a document from a collection
    26. Getting a list of documents from a collection
    27. Query cursors
    28. Compound queries
    29. Sub-collection queries
    30. Deleting a document
    31. Some points to remember when using Firestore
    32. Summary
  17. Chapter 9: Data Management and Database Strategies
    1. Technical requirements
    2. How to decide which database fits your needs
    3. Cloud SQL
    4. Cloud Spanner
    5. Bigtable
    6. Firestore
    7. Choosing the right database
    8. Data management strategies for your databases in Google Cloud
    9. What is database sharding?
    10. What is hot-spotting, and why should you avoid it?
    11. Defining a key structure for high-write applications in Bigtable
    12. Key design in Cloud Spanner
    13. Defining keys for Firestore to avoid hot-spotting
    14. Database and application management best practices
    15. Keep your Cloud SQL small
    16. Be prepared to fail
    17. Improve the speed of your database to import data
    18. Have a recovery plan
    19. Optimize query execution in Cloud Spanner
    20. Optimize bulk loading in Cloud Spanner
    21. Optimize update operations in Cloud Spanner
    22. Bigtable test best practices
    23. Firestore location cases
    24. Avoid hot-spotting due to read and write operations in collections
    25. Reading and writing documents from Firestore
    26. Reduce costs and remove limits with indexing exemption
    27. Summary
  18. Chapter 10: Optimizing Applications with Caching Strategies on Google Cloud Platform
    1. Technical requirements
    2. How, when, and why you should use a caching strategy in your applications
    3. Why is having a cache strategy important?
    4. When can we implement a cache strategy?
    5. How can we implement a caching strategy?
    6. Handling high traffic volumes with Memorystore for Memcached
    7. Creating a Memcached instance
    8. Connecting to a Memcached instance
    9. Optimizing your application with Memorystore for Redis
    10. Creating a Redis instance
    11. Connecting to a Redis instance
    12. Summary
  19. Section 4: SRE for Developers
  20. Chapter 11: Logging on Google Cloud Platform
    1. Technical requirements
    2. Introduction to Cloud Logging, the logging solution of GCP
    3. Learning logging best practices in the cloud
    4. Use libraries in your application to record logs
    5. Don't create all logs on a single level
    6. Categorize your logs correctly
    7. Add meaningful descriptions
    8. Make your logs understandable to both humans and machines
    9. Add unique event IDs
    10. Review your logging ingestion metrics
    11. Exclude logs for cost optimization
    12. How to enable an application to create custom logs
    13. Enabling an app to create custom logs
    14. Using Cloud Storage for cost optimization
    15. Using Pub/Sub to trigger events
    16. Using BigQuery for logs analysis
    17. How to watch logs and make advanced logging queries on Cloud Logging
    18. Our first search query
    19. Advanced queries
    20. Real-case logging examples using Cloud Logging and Cloud Monitoring
    21. Centralization of multiple logs in a GCP project
    22. Automatic error alerts
    23. Summary
  21. Chapter 12: Cloud Monitoring, Tracing, and Debugging
    1. Technical requirements
    2. Your first operational dashboard and metrics
    3. Creating your first workspace
    4. Creating your first dashboard
    5. Monitoring your application uptime 24/7
    6. Creating an uptime check
    7. Finding bugs in your application with cloud debugging
    8. Creating our base application
    9. Using Cloud Debugger
    10. Creating a snapshot
    11. Creating a logpoint
    12. Optimizing your application with cloud tracing and profiling
    13. Cloud Trace
    14. Cloud Profiler
    15. Using Cloud Trace in our application
    16. Using Cloud Profiler in our application
    17. Real case examples using cloud monitoring, debugging, and tracing for applications on GCP
    18. Cloud monitoring SLOs
    19. Cloud Debugger in the cloud
    20. Cloud Trace cases
    21. Official documentation resources
    22. Summary
  22. Section 5: Analyzing a Sample Case Study
  23. Chapter 13: HipLocal Sample Case Study Preparation
    1. Technical requirements
    2. Pro tips to ace the sample case study
    3. Sample case structure
    4. How to order the case information
    5. Map services and technologies with Google Cloud
    6. Reviewing the executive statement, existing solution, and requirements
    7. Executive statement
    8. Existing technical environment
    9. Reviewing the technical requirements
    10. Reviewing the business requirements
    11. Architecting the solution
    12. Summary
  24. Chapter 14: Questions and Answers
    1. Technical requirements
    2. Questions
    3. Google Cloud Platform (GCP) developer fundamentals
    4. Security fundamentals and best practices
    5. Application modernization using Google Cloud
    6. Using Cloud Functions and GAE
    7. Virtual machines (VMs) and container applications on GCP
    8. Managing APIs on GCP
    9. Handling unstructured data
    10. Databases and event messages in Google Cloud
    11. Data management and database strategy
    12. Optimizing applications with caching strategies on GCP
    13. Logging on GCP
    14. Cloud monitoring, tracing, and debugging
    15. Answers
    16. GCP developer fundamentals
    17. Security fundamentals and best practices
    18. Application modernization using Google Cloud
    19. Using Cloud Functions and GAE
    20. VMs and container applications on GCP
    21. Managing APIs on GCP
    22. Handling unstructured data
    23. Databases and event messages in Google Cloud
    24. Data management and database strategy
    25. Optimizing applications with caching strategies on GCP
    26. Logging on GCP
    27. Cloud monitoring, tracing, and debugging
    28. Summary
    29. Why subscribe?
  25. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts
54.198.108.174