You have a simple HTTP API that needs to scale automatically and handle short requests. Which service is best suited for this?
Think about which service supports containers and automatic scaling for HTTP.
Cloud Run supports containerized applications and automatically scales based on HTTP traffic. Cloud Functions also supports HTTP but is more limited to function code rather than full containers.
You want to process events from a Pub/Sub topic with a function that runs quickly and scales automatically. Which service should you choose?
Consider which service integrates directly with Pub/Sub and is optimized for short event processing.
Cloud Functions natively supports Pub/Sub triggers and automatically scales for short-lived event processing. Cloud Run can be triggered by Pub/Sub but requires additional setup.
You deploy a Cloud Run service that should only be accessible by authenticated users from your organization. Which approach enforces this?
Think about built-in Google Cloud tools for authentication and access control.
Cloud Run can require authentication and integrates with IAP to restrict access to users in your organization. Allowing unauthenticated access or relying on firewall rules is less secure.
You have a backend service with unpredictable traffic spikes. You want to minimize cost while ensuring fast response times. Which service and configuration is best?
Consider how to balance cost and performance with scaling settings.
Cloud Run can scale down to zero instances to save cost and scale up quickly on demand. Setting minimum instances high increases cost. Cloud Functions scales automatically but you cannot fix instance count.
You deploy a Cloud Function and a Cloud Run service. Both receive HTTP requests that take 10 minutes to process. What happens to the requests?
Check default and maximum request timeout limits for each service.
Cloud Functions has a maximum timeout of 9 minutes. Cloud Run allows configuring request timeout up to 60 minutes or more, so it can handle longer requests.