使用Firebase Cloud功能实施Cloud Run [英] Implementing Cloud Run with Firebase Cloud Functions

查看:90
本文介绍了使用Firebase Cloud功能实施Cloud Run的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在阅读了有关Cloud Run和Firebase Cloud Functions的文档之后,我有几个问题需要解决:

After reading the docs on both Cloud Run and Firebase Cloud Functions, I have a few questions I want to clear up:

  1. Cloud Run是否基本上充当容器映像存储/部署机制?如果我有2个网站,并将它们作为单独的容器化映像,则Cloud Run是否仅在触发条件下部署指定的网站?

  1. Does Cloud Run basically act as a container image storage/deploying mechanism? If I have 2 websites and have them as separate containerized images, does Cloud Run just deploy the specified one given the trigger?

使用Firebase Cloud Functions集成Cloud Run作为触发器,是否会有额外的延迟层?虽然延迟时间是未知的,但由于冷启动,FCF本质上具有预热时间,由于Cloud Run冷启动图像会增加延迟吗?

Integrating Cloud Run with Firebase Cloud Functions as the trigger, will there be an additional layer of latency? While latency times are never known, FCFs inherently have warm-up times due to cold starts, will there be added latency due to Cloud Run cold-starting the images?

Cloud Run映像是否通过FCF传递给用户.还是FCF只是将用户直接重定向到Cloud Run映像?

Does the Cloud Run images travel through the FCF to get to the user. Or does FCF merely redirect the user directly to the Cloud Run image?

基本上是这样

Client -> FCF -> Image -> FCF -> Client

Client -> FCF -> Image -> Client

推荐答案

通常,在Stack Overflow上,每个帖子只能限制一个问题(以避免被封闭为过于宽泛"),但是我将在这里尝试.请作为新帖子解决后续问题.

Typically on Stack Overflow one is supposed to limit to one question per post (to avoid being closed as "too broad"), but I'll try here. Please address followup questions as new posts.

  1. 是的,它只是服务HTTP请求的容器化方式.

  1. Yes, it is just a containerized way of serving HTTP requests.

云运行"与云功能"没有直接关系,除非您编写代码来连接它们.如果编写了一个可以替代Cloud Run的Cloud Function触发器,则它将根据需要承担这两个产品的所有延迟成本(并非所有调用都需要冷启动).所有无服务器"计算选项的启动时间都是冷的,因为它们都缩小为零(基于当前负载),并且您无需为虚拟服务器实例一直分配和立即可用而付费.

Cloud Run is not directly related to Cloud Function except where you write code to connect them. If you write a Cloud Function trigger that proxies to Cloud Run, it will incur all the latency costs of both products, as required (not all invocations require a cold start). All "serverless" compute options have a cold start time, since they all scale down to zero (based on current load), and you don't pay for virtual server instances to be allocated and immediately available all the time.

同样,它们没有关联.您可以使用任何一个,而不能使用另一个.

Again, they are not related. You can use either one without the other.

这篇关于使用Firebase Cloud功能实施Cloud Run的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆