What is Cloud Functions?
Answer
Cloud Functions is GCP's serverless, event-driven compute service for running single-purpose code in response to events. Deploy a function; Google manages everything else. Triggers: HTTP (REST API), Cloud Pub/Sub, Cloud Storage (new file), Firestore, Firebase, and more. Supports Node.js, Python, Go, Java, .NET, Ruby, PHP. Gen 1: original version, one request per instance. Gen 2 (built on Cloud Run): better performance, larger instances, concurrency, longer timeouts, and VPC access. Use cases: image processing triggered by Cloud Storage uploads, database change processing, scheduled tasks, and lightweight microservices. For stateful or long-running workloads, use Cloud Run instead. Cloud Functions are billed per invocation, compute time, and networking.