Serverless Functions Explained

Best Free Serverless Functions 2026 | Free Tier Comparison

A serverless function is not a smaller server. It is a short-lived piece of backend code that runs only when something happens: a request, webhook, queue message, cron schedule, file upload, or database event. For full-stack developers, it is best understood as a route handler, job worker, and integration glue layer that you do not keep running all day.

Mental model

Use functions for short, event-triggered work.

Do not use them as tiny always-on servers.

Keep state in databases, queues, KV, or object storage.

Last Updated: 2026-05-22

The concept in full-stack terms

A function is a small backend endpoint

Think of it as one route handler or job packaged separately from a server. You upload code, the platform runs it when an HTTP request, queue message, database event, cron schedule, or webhook arrives.

You pay for execution, not idle time

A traditional server stays on. A function starts when needed, runs briefly, then disappears. This is why free tiers can be generous for low-volume automations and APIs.

It is not a tiny VPS

Do not expect long-lived memory, local disk, background daemons, or stable TCP connections. Functions are best when each invocation can finish independently.

Edge functions and cloud functions differ

Edge functions run close to users and are great for fast request rewriting, auth checks, and lightweight APIs. Regional cloud functions are better for heavier jobs, integrations, and backend events.

What serverless functions are actually good for

Webhooks and payment callbacks

Receive Stripe, GitHub, Slack, Notion, or payment-provider events without keeping a server online all day.

Thin API layer for static sites

Add contact forms, newsletter signup, search proxying, signed uploads, AI calls, and database writes to static hosting.

Scheduled maintenance jobs

Run sitemap refreshes, cache warmups, report emails, database cleanup, quota checks, and lightweight monitoring on a schedule.

Auth and request middleware

Validate JWTs, rewrite URLs, route traffic, enrich headers, block abusive requests, or adapt APIs at the edge before hitting your origin.

Glue between cloud services

Connect storage events to image processing, queues to email sending, database changes to notifications, and third-party APIs to internal workflows.

Burstable AI or data tasks

Useful for short AI moderation, embeddings calls, PDF parsing, metadata extraction, and one-off transforms, as long as timeouts and cost caps are respected.

Quick recommendations

Choose by trigger, runtime limits, and where the function lives relative to your frontend, database, and users.

Free serverless functions comparison table

Use the table for quota scanning. The surrounding sections explain what those quotas mean in real full-stack architecture.

PROVIDERFREE STORAGEMONTHLY BANDWIDTHSPECS / COMPUTECONNECTION LIMITSKEY CONSTRAINTSACTION
Cloudflare WorkersV8 ISOLATE / EDGE
100k Requests / Day
Unmetered IngressMax 10ms CPU time per request, Global Edge NetworkAuto-ScalingHard 10ms CPU limit; strictly bursts on heavy algorithmsGo to Site
AWS LambdaFAAS / EVENT-DRIVEN
1M Requests / Month
400k GB-Seconds free/moSupports x86 & ARM64 (Graviton2)Auto-ScalingCold start latencies on infrequent hitsGo to Site
Microsoft AzureAZURE FUNCTIONS
1M Requests / Month
400k GB-Seconds (Consumption Plan)Requires companion storage account (micro-fees apply)Auto-ScalingLinux runtime v3 end-of-life; must target v4 architectureGo to Site
Cloud Functions for FirebaseEVENT-DRIVEN / SERVERLESS
No-Cost Quota Amounts
Triggers from Firebase, HTTPS, Admin SDK, and Cloud Scheduler jobsManaged JavaScript, TypeScript, or Python functions with automatic scaling and Firebase/Google Cloud integrationBuilt for event-driven app backends that want zero server managementDeploying beyond free quota requires Blaze pay-as-you-go billing; not a permanently free production runtimeGo to Site
Alibaba Cloud (Aliyun)FUNCTION COMPUTE
1M Invocations / Mo
400k CU-Seconds free quotaExcellent GPU/AI Inference scaling setupAuto-ScalingStrict bill-shock risk if under heavy web attackGo to Site
Alibaba Cloud (China)FUNCTION COMPUTE
3-Month Free Trial Only
1M Calls / 400k GB-Secs (Resets for 3 cycles)GPU-accelerated runtime optimization availableAuto-ScalingNOT Always Free; auto-switches to raw pay-as-you-go billing after 3 monthsGo to Site
Tencent Cloud (SCF)CLOUD FUNCTION
3-Month Free Trial
1M GBs + 2GB Outbound (Trial)Switches to paid subscription packages after 3 monthsAuto-ScalingNOT Always Free; requires paid minimum monthly plan post-trialGo to Site
Tencent Cloud (China)CLOUD FUNCTION (SCF)
3-Month Free Trial Only
1M Calls / 1M GBs / 2GB Outbound (First 3 Mo)Requires minimum subscription package (~9.9 RMB/mo) post-trialAuto-Scaling0 free tier after 3 months; charges daily minimum subscription fee permanentlyGo to Site
Vercel FunctionsNEXT.JS API
50k Requests / Day
Shared 100GB Bundle1024MB Default Memory allocationAuto-ScalingMax 10s timeout; strict Non-Commercial Hobby ruleGo to Site
Netlify FunctionsJAMSTACK API
125k Requests / Month
100 Hours compute limitAWS Lambda downstream encapsulationAuto-ScalingMonthly quota reset; hard site 502 error on exhaustGo to Site

How to choose serverless functions

Start from the trigger

HTTP request, cron schedule, queue message, file upload, database event, and auth callback are different shapes. Pick the function platform that naturally supports your trigger.

Check timeout before writing code

A 10-second API route, a 15-minute Lambda job, and a 10ms CPU edge worker are completely different tools. Timeout and CPU shape decide the architecture.

Keep state somewhere else

Use databases, queues, object storage, KV, or durable objects for state. Treat local memory and local files inside a function as disposable.

Cap blast radius before launch

Functions auto-scale by design. Add rate limits, auth, budget alerts, idempotency, and retry controls before exposing them to the public Internet.

Serverless traps to check

Bill shock from auto-scaling

A public endpoint can scale under traffic, bots, retries, or attacks. Free tiers are useful, but a missing rate limit can turn them into paid traffic multipliers.

Cold starts break perceived speed

Cold starts are fine for cron jobs and async tasks. They are painful for login flows, payment callbacks, chat commands, and first-page API calls.

Database connections are easy to exhaust

Many concurrent function instances can open too many database connections. Use connection pooling, HTTP database APIs, queues, or provider-specific serverless drivers.

Retries can duplicate side effects

Event systems retry failed functions. Without idempotency keys, one payment, email, webhook, or database update can happen more than once.

Recommended function patterns

Cloudflare Pages + Workers + Supabase

Use Pages for the frontend, Workers for edge middleware and lightweight APIs, and Supabase for durable Postgres/Auth state.

Static site + function contact form

A classic first use case: static hosting serves the site, a serverless function validates input, sends email, and writes a small record.

Queue + function + object storage

A durable background pattern for image processing, document parsing, report generation, and webhook fan-out.

Related categories

Serverless functions FAQ

What can serverless functions actually do?+

They can handle webhooks, small APIs, form submissions, scheduled jobs, auth checks, file-processing events, queue consumers, AI API calls, and glue code between cloud services. They are best for short, event-triggered work.

When should I not use serverless functions?+

Avoid them for long-running services, stable WebSocket servers, heavy CPU jobs, stateful processes, local-disk workloads, and systems that cannot tolerate cold starts or retries.

Are edge functions and serverless functions the same?+

They overlap, but edge functions are optimized to run close to users with tighter runtime limits. Regional serverless functions usually support heavier runtimes, longer execution, and deeper cloud integrations.

Can functions replace my backend?+

They can replace parts of a backend: API routes, webhooks, jobs, and integration code. They do not replace durable state, database design, queues, auth strategy, or observability.

Which free function platform should I try first?+

Try Cloudflare Workers first for edge middleware and lightweight APIs. Try AWS Lambda for event-driven cloud automation. Try Vercel or Netlify Functions when your functions are attached to a frontend project.