Building serverless applications with Google Cloud Run : a real-world guide to building production-ready services 🔍
Wietse Venema O'Reilly Media, Incorporated; O'Reilly Media, 1, 2020
英语 [en] · PDF · 11.7MB · 2020 · 📘 非小说类图书 · 🚀/lgli/lgrs/nexusstc/upload/zlib · Save
描述
Learn how to build a real-world serverless application in the cloud that's reliable, secure, maintainable, and scalable. If you have experience building web applications on traditional infrastructure, this hands-on guide shows you how to get started with Cloud Run, a container-based serverless product on Google Cloud.
Through the course of this book, you'll learn how to deploy several example applications that highlight different parts of the serverless stack on Google Cloud. Combining practical examples with fundamentals, this book will appeal to developers who are early in their learning journey as well as experienced practitioners.
• Build a serverless application with Google Cloud Run
• Learn approaches for building containers with (and without) Docker
• Explore Google Cloud's managed relational database: Cloud SQL
• Use HTTP sessions to make every user's experience unique
• Explore identity and access management (IAM) on Cloud Run
• Provision Google Cloud resources using Terraform
• Learn how to handle background task scheduling on Cloud Run
• Move your service from Cloud Run to Knative Serving with little effort
备用文件名
nexusstc/Building Serverless Applications with Google Cloud Run: A Real-World Guide to Building Production-Ready Services/dd9573e14145633e813e242da7a1df56.pdf
备用文件名
lgli/OReilly.Building.Serverless.Applications.with.Google.Cloud.Run.1492057096.pdf
备用文件名
lgrsnf/OReilly.Building.Serverless.Applications.with.Google.Cloud.Run.1492057096.pdf
备用文件名
zlib/Computers/Programming/Wietse Venema/Building Serverless Applications with Google Cloud Run: A Real-World Guide to Building Production-Ready Services_17057838.pdf
备选标题
Mastering Serverless Applications with Google Cloud Run
备选作者
Venema, Wietse;
备用版本
O'Reilly Media, [Place of publication not identified&#x5d], 2020
备用版本
United States, United States of America
备用版本
Sebastopol, CA, 2020
备用版本
Cambridge, 2021
备用版本
1, US, 2021
元数据中的注释
Vector PDF
元数据中的注释
lg3093398
元数据中的注释
producers:
Antenna House PDF Output Library 6.2.609 (Linux64)
元数据中的注释
{"edition":"1","isbns":["1492057096","9781492057093"],"last_page":202,"publisher":"O'Reilly Media"}
备用描述
Cover 1
Copyright 6
Table of Contents 7
Foreword 15
Preface 19
Why I Wrote This Book 19
Who This Book Is For 19
Why Use the Go Language? 20
Navigating This Book 20
Conventions Used in This Book 21
Using Code Examples 22
O’Reilly Online Learning 23
How to Contact Us 23
Acknowledgments 23
Chapter 1. Introduction 27
Serverless Applications 27
A Simple Developer Experience 28
Autoscalable Out of the Box 29
A Different Cost Model 30
Serverless Is Not Functions as a Service 31
Google Cloud 31
Serverless on Google Cloud 33
Cloud Run 34
Service 34
Container Image 34
Scalability and Self-Healing 35
HTTPS Serving 35
Microservices Support 35
Identity, Authentication, and Access Management 35
Monitoring and Logging 36
Transparent Deployments 36
Pay-Per-Use 36
Concerns About Serverless 36
Unpredictable Costs 37
Hyper-Scalability 37
When Things Go Really Wrong 37
Separation of Compute and Storage 37
Open Source Compatibility 38
Summary 38
Chapter 2. Understanding Cloud Run 39
Getting Started with Google Cloud 39
Costs 40
Interacting with Google Cloud 40
Google Cloud Projects 41
Installing and Authenticating the SDK 41
Installing Beta Components 42
Deploying Your First Service 42
Deploying the Sample Container 42
Region 43
Structure of the HTTPS Endpoint 44
Viewing Your Service in the Web Console 44
Deploying a New Version 45
Revision 46
Understanding Cloud Run 48
Container Life Cycle 48
CPU Throttling 50
Task Scheduling and Throttling 50
Load Balancer and Autoscaler 50
Concurrent Request Limit 52
Autoscaler 52
Tuning the Concurrency Setting 53
Cold Starts 53
Disposable Containers 53
In-Memory Filesystem 54
Ready for Requests 54
Cloud Run Key Points 54
Choosing a Serverless Compute Product on Google Cloud 55
Cloud Functions: Glue Code 55
App Engine: Platform as a Service 56
Key Differences 56
What Will the Future Look Like? 57
Summary 58
Chapter 3. Building Containers 59
Containers: A Hands-On Exploration 60
Running an Interactive Shell 60
Overriding the Default Command 61
Running a Server 61
Containers from First Principles 62
Inside a Container Image 62
The Linux Kernel 63
Container Isolation 64
Starting a Container 65
Building a Container with Docker 66
Dockerfile Instructions 67
Installing Additional Tooling 68
Smaller Is Better When Deploying to Production 69
Creating Small Containers with Distroless 69
Artifact Registry 70
Building and Tagging the Container Image 71
Authenticating and Pushing the Container Image 72
Building a Container Without a Dockerfile 72
Go Containers with ko 73
Java Containers with Jib 75
Cloud Native Buildpacks 75
Cloud Build 76
Remote Docker Build 77
Advanced Builds 77
Running Arbitrary Programs 79
Connecting with Version Control 79
Shutting Down 80
Summary 80
Chapter 4. Working with a Relational Database 81
Introducing the Demo Application 81
Creating the Cloud SQL Instance 83
Understanding Cloud SQL Proxy 84
Connecting and Loading the Schema 85
Securing the Default User 86
Connecting Cloud Run to Cloud SQL 87
Disabling the Direct Connection 88
Deploying the Demo Application 89
Connection String 90
Public and Private IP 90
Limiting Concurrency 91
Transaction Concurrency 92
Resource Contention 93
Scaling Boundaries and Connection Pooling 93
External Connection Pool 94
A Real-World Example 95
Cloud SQL in Production 95
Monitoring 95
Automatic Storage Increase 95
High Availability 95
Making Your Application Resilient Against Short Downtime 96
Shutting Down 96
Summary 96
Chapter 5. Working with HTTP Sessions 97
How HTTP Sessions Work 98
Storing Sessions in Memorystore: A Hands-On Exploration 99
Creating a Memorystore Instance 99
What Is a VPC Connector? 100
Creating a VPC Connector 102
Deploying the Demo App 103
Alternative Session Stores 104
Session Affinity 105
Use Cases 105
Session Affinity Is Not for Session Data 106
Shutting Down 106
Summary 106
Chapter 6. Service Identity and Authentication 107
Cloud IAM Fundamentals 107
Roles 107
Policy Binding 108
Service Accounts 111
Creating and Using a New Service Account 113
Sending Authenticated Requests to Cloud Run 114
Deploying a Private Service 115
Using an ID Token to Send Authenticated Requests 116
When Is an ID Token Valid? 117
Programmatically Calling Private Cloud Run Services 117
Google Frontend Server 118
A Story About Inter-Service Latency 119
Demo Application 119
Embedded Read-Only SQL Database 120
Running Locally 120
Edit, Compile, Reload 121
Deploying to Cloud Run 122
Update the Frontend Configuration 123
Add Custom Service Accounts 123
Add IAM Policy Binding 124
Summary 124
Chapter 7. Task Scheduling 125
Cloud Tasks 125
Hands-On Learning: A Demo Application 127
Building the Container Images 127
Creating a Cloud Tasks Queue 128
Creating Service Accounts 128
Deploying the Worker Service 128
Deploying the Task App Service 129
Connecting the Task Queue 129
Scheduling a Task with the Cloud Tasks Client Library 130
Automatic ID Token 131
Connecting the Worker 131
Test the App 131
Queue Configuration 132
Retry Configuration 132
Rate Limiting 133
Viewing and Updating Queue Configuration 133
Considerations 133
Cloud Tasks Might Deliver Your Request Twice 133
Local Development 134
Alternatives 134
Summary 135
Chapter 8. Infrastructure as Code Using Terraform 137
What Is Infrastructure as Code? 137
Why Infrastructure as Code? 138
Serverless Infrastructure 139
How It Works 139
When Not to Use Infrastructure as Code 140
Terraform 141
Installing Terraform 141
Getting Started with a Minimal Example 142
The Terraform Workflow 148
Change with Terraform: Adding the Access Policy 150
Expressing Dependencies with References 151
Supplemental Resources 152
Summary 153
Chapter 9. Structured Logging and Tracing 155
Logging on Cloud Run 155
Viewing Logs in the Web Console 156
Viewing Logs in the Terminal 156
Finding Invisible Logs 157
Plain-Text Logs Leave You Wanting More 158
Demo Application 158
Structured Logging 158
Client Libraries 160
Structured Logging in Other Languages 160
How to Use Log Levels 160
Capturing Panics 161
Local Development 163
Request Context 163
Trace Context 165
Forwarding Trace ID 165
Preparing All Incoming Requests with the Trace ID 167
Passing Request Context to Outgoing Requests 167
Viewing Trace Context in Cloud Logging 169
Additional Resources About Tracing 169
Log-Based Metrics with Cloud Monitoring 169
Summary 170
Chapter 10. Cloud Run and Knative Serving 173
What Is Knative Serving? 174
Cloud Run Is Not Managed Knative Serving 174
Knative Serving on Google Cloud 174
Understanding Kubernetes 175
API Server 176
Kubernetes Resources 177
Database 177
Controllers 177
Adding Extensions to Kubernetes 178
Running Knative Serving Locally 178
Running a Local Kubernetes Cluster 178
Installing Minikube and kubectl 179
Starting Your Local Cluster 179
Install the Knative Operator 180
Starting Minikube Tunnel 181
Installing an HTTP Load Balancer 182
Configuring DNS 183
Deploying a Service 183
Deploying the Same Service to Cloud Run 184
Alternative API Clients 184
Shutting Down 185
Discussion 185
Serving 185
Moving from Kubernetes to Cloud Run Is Harder 185
Service Identity and Authentication 185
Proprietary Managed Services 186
Summary 186
Index 187
About the Author 202
Colophon 202
备用描述
Learn How To Build A Serverless Real-world Application In The Cloud That's Reliable, Secure, Maintainable, And Can Handle Millions Of Users. If You Have Experience Building Traditional Web Applications, This Practical Guide Shows You How To Get Started With Serverless. Cloud Engineer Wietse Venema Takes You Through The Steps Necessary To Build Serverless Applications With Cloud Run, A Container-based Serverless Platform On Google Cloud. Through The Course Of The Book, You'll Learn How To Become Productive With Serverless Technology. You Will Build And Explore Several Example Applications That Highlight Different Parts Of The Serverless Stack, Using (light) Frontend Technology And Go On The Back End. You Can Also Follow The Lessons In The Book Using Your Own Project On Google Cloud Platform. You'll Learn How To: Build A Serverless Application With Google's Cloud Run And Firestore Approach Testing And Development Handle User Management And Authentication Combine Serverless With A Traditional Relational Database Run And Monitor Production Services Integrate Your Application With External Apis
备用描述
Learn how to build a serverless real-world application in the cloud that's reliable, secure, and scalable. If you have experience building web applications on traditional infrastructure, this comprehensive and approachable guide shows you how to get started with serverless containers on Cloud Run.
Throughout the course of the book, you'll deploy and explore several example applications that highlight different parts of the serverless stack on Google Cloud. Combining practical examples with fundamentals, this book will appeal to both developers who are early in their learning journey and experienced practitioners.
You'll learn
备用描述
A hands-on guide explains how to build real-world serverless applications in the cloud that are reliable, secure, maintainable, and scalable using Cloud Run, a container-based serverless product on Google Cloud, covering such topics as approaches for building containers with and without Docker, Cloud SQL, identity and access management, and background task scheduling
备用描述
"Learn how to build a serverless real-world application in the cloud that's reliable, secure, and scalable. If you have experience building web applications on traditional infrastructure, this comprehensive and approachable guide shows you how to get started with serverless containers on Cloud Run"--Amazon.com
开源日期
2021-08-23
更多信息……

🚀 快速下载

成为会员以支持书籍、论文等的长期保存。为了感谢您对我们的支持,您将获得高速下载权益。❤️
如果您在本月捐款,您将获得双倍的快速下载次数。

🐢 低速下载

由可信的合作方提供。 更多信息请参见常见问题解答。 (可能需要验证浏览器——无限次下载!)

所有选项下载的文件都相同,应该可以安全使用。即使这样,从互联网下载文件时始终要小心。例如,确保您的设备更新及时。
  • 对于大文件,我们建议使用下载管理器以防止中断。
    推荐的下载管理器:JDownloader
  • 您将需要一个电子书或 PDF 阅读器来打开文件,具体取决于文件格式。
    推荐的电子书阅读器:Anna的档案在线查看器ReadEraCalibre
  • 使用在线工具进行格式转换。
    推荐的转换工具:CloudConvertPrintFriendly
  • 您可以将 PDF 和 EPUB 文件发送到您的 Kindle 或 Kobo 电子阅读器。
    推荐的工具:亚马逊的“发送到 Kindle”djazz 的“发送到 Kobo/Kindle”
  • 支持作者和图书馆
    ✍️ 如果您喜欢这个并且能够负担得起,请考虑购买原版,或直接支持作者。
    📚 如果您当地的图书馆有这本书,请考虑在那里免费借阅。