switch·Esc back

Serverless

You might say

I only have a small feature. Is there a way to run code on demand without buying or managing a server?

Run backend code on demand without managing a long-running serverA serverless function is deployed to a managed platform and starts when an HTTP request, schedule, or event triggers it. It reduces server operations for small independent tasks, but runtime limits, cold starts, regions, and stateless execution still shape the design.
RequestPOST /api/contact
⚡ FunctionPlatform starts on demand
Response200 OK
The instance is 0 when there are no requests · Billed by the number of runs

When to use it

  • Small API endpoint
  • Webhook handler
  • Scheduled task
  • Event-driven processing with irregular traffic

When NOT to use it

  • Keep important state only in function memory
  • Run a long job beyond the platform limit
  • Assume there is no infrastructure or cost to manage
  • Split a simple workflow into too many tiny functions
Anatomy
API gatewayFunction instanceExternal status
The platform handles URLs, HTTPS, scaling, and request routing.
Your code runs when a request or event arrives.
Persistent state lives in databases or storage, not function memory.
Typical use cases
Contact form API
Next.js API RouteDeploys with the frontend project
git pushPlatform build/api/contact available
Depends on the repository branch and deployment settings
Payment webhook
Contact formRequest one email at a time
Send
Function resultEmail sent
Scheduled email
Payment callbackUpdate orders after receiving platform events
payment.succeededVerify signatureOrder changed to paid
should be designed to be idempotent to avoid repeated accounting for the same callback
Image processing trigger
Scheduled tasksAutomatically perform a summary every day
ScheduleEvery day at 09:00ActionGenerate yesterday's dataRecent run✓ 12.4s