What is faas?

FaaS stands for “Function as a Service.” It is a cloud computing model where you write small pieces of code called functions, upload them to a provider (like AWS Lambda, Google Cloud Functions, Azure Functions), and the provider runs those functions only when they are needed. You don’t have to manage servers, operating systems, or runtime environments - you just focus on the code itself.

Let's break it down

  • Function: A single, self‑contained piece of code that does one specific task (e.g., resize an image, send an email, process a webhook).
  • As a Service: The cloud provider hosts the function, automatically allocates the compute resources, and scales it up or down based on demand.
  • Event‑driven: Functions are triggered by events such as an HTTP request, a file being uploaded, a timer, or a message in a queue.
  • Pay‑per‑use: You are billed only for the time your function runs (usually measured in milliseconds) and the resources it consumes.

Why does it matter?

FaaS removes the heavy lifting of server management, letting developers ship features faster. It reduces costs because you only pay for actual execution time, not idle server capacity. It also scales instantly - if a function is called 1 time or 10,000 times, the platform handles the load without you needing to provision extra hardware.

Where is it used?

  • Web APIs: Small endpoints that respond to HTTP requests (e.g., a “send‑reset‑password” function).
  • Data processing: Transforming files when they land in cloud storage (e.g., generating thumbnails).
  • Automation: Running scheduled jobs like nightly backups or report generation.
  • IoT: Handling sensor data streams and reacting in real time.
  • Chatbots & voice assistants: Processing user messages and returning responses.

Good things about it

  • No server maintenance - the provider handles OS patches, scaling, and availability.
  • Cost‑efficient - you pay only for actual compute time.
  • Rapid development - focus on business logic, not infrastructure.
  • Automatic scaling - handles spikes in traffic without manual intervention.
  • Language flexibility - most platforms support multiple programming languages.

Not-so-good things

  • Cold start latency - the first call after a period of inactivity can be slower while the platform spins up a container.
  • Limited execution time - most providers cap how long a function can run (often 5-15 minutes).
  • Vendor lock‑in - code may rely on specific platform APIs, making migration harder.
  • Debugging complexity - testing locally can differ from the cloud environment, and logs may be harder to trace.
  • Statelessness - functions can’t keep data in memory between invocations, so you need external storage for state.