Nerdragen
Nerdragen

Reputation: 3194

Implementing Cloud Run with 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. 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
    

Upvotes: 1

Views: 564

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317497

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.

Upvotes: 1

Related Questions