Implementing Cloud Run with Firebase Cloud Functions

别来无恙 提交于 2019-12-13 04:36:21

问题


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

  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?

  2. 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?

  3. 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?

    Basically, is it like

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

    or

    Client -> FCF -> Image -> Client
    

回答1:


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. Yes, it is just a containerized way of serving HTTP requests.

  2. 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.

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



来源:https://stackoverflow.com/questions/58548947/implementing-cloud-run-with-firebase-cloud-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!