What is Serverless Function?

Turkish: Serverless Fonksiyon

A serverless function is a short-lived cloud code unit triggered by events such as HTTP requests, queue messages, cron jobs, or file uploads.

What is a Serverless Function?

A serverless function is a small, independent piece of code that runs when a specific event occurs. It may return JSON for an HTTP request, process a webhook from a payment provider, consume a queue message, or generate a nightly report file.

When the function is idle, it usually does not reserve compute capacity. The provider starts the runtime, executes the code, returns the result, and manages capacity automatically. For that reason, functions should be short, idempotent, and resilient to external dependency failures.

Design Considerations

  • Stateless execution: Persistent state belongs in a database, KV store, object storage, or queue.
  • Time limits: The function must finish within the provider’s execution window.
  • Cold starts: The first call after inactivity can be slower.
  • Retry behavior: Reprocessing the same event must not create duplicate records.
  • Secrets: API keys should be stored through environment variables or secret managers.

Business Use

Serverless functions are strong fits for small integration tasks: writing form submissions to a CRM, checking e-invoice status on a schedule, resizing images, or updating an order after a payment notification.

Lambda, Cloudflare Workers, and edge computing based functions apply the same idea in different runtimes. For critical flows, timeout handling, logging, alerts, retries, and dead-letter queues matter as much as the function code itself.