"Serverless" doesn't mean there are no servers. It means you don't have to deal with them.
You don't provision machines, you don't configure auto-scaling, you don't patch operating systems. You write code, deploy it, and the infrastructure handles the rest. You pay only for what you use — per millisecond, per request, per GB.
Edge computing takes the idea further: your code runs physically close to the user, on globally distributed servers, not in a single datacenter.
In short: Serverless eliminates server management — you pay only per request, scaling is automatic. Best use cases: APIs, background processing, cron jobs. Not suited for heavy processing (video, ML).
Serverless: How It Works
The Traditional Model
You rent a server (or a virtual machine). It runs regardless of whether it has traffic or not. You manage:
- The operating system and updates
- Scaling (adding servers when traffic increases)
- Infrastructure-level security
- The fixed monthly cost (you pay even when the server is idle)
The Serverless Model
You write individual functions. Each function executes on demand — when it receives a request, an event, or a cron trigger. The platforms handle:
- Automatic scaling
- Availability — redundancy, failover, monitoring
- Security — patching, isolation, certificates
- Billing — you pay only for actual executions
Major Serverless Platforms
| Platform | Provider |
|---|---|
| AWS Lambda | Amazon |
| Cloudflare Workers | Cloudflare |
| Google Cloud Run functions | |
| Azure Functions | Microsoft |
| Deno Deploy | Deno |
| Vercel Functions / Netlify Functions | Vercel / Netlify |
Edge Computing: Code Close to the User
What Edge Solves
With edge computing, your code runs across distributed locations and each user can reach a nearby node.
Edge Platforms
- Cloudflare Workers — edge runtime with integrated storage and messaging services
- Deno Deploy — integrated with the Deno runtime
- AWS CloudFront Functions / Lambda@Edge — functions at Amazon's CDN level
- Fastly Compute — edge compute platform
Edge vs. Classic Serverless
| Aspect | Classic Serverless | Edge |
|---|---|---|
| Languages | Multiple | JS/TS/WASM (typically) |
| Databases | Access to any DB | Edge-native DBs (D1, Turso, Neon) |
| Complexity | Larger, more complex functions | Small, fast functions |
| Use case | Backend logic, processing | Fast APIs, personalization, routing |
Practical Use Cases
1. APIs and Backend Logic
The most common case. Instead of maintaining a permanent Express/Fastify server, each endpoint is a serverless function:
POST /api/contact→ function that processes the form and sends an emailGET /api/products→ function that queries the database and returns JSONPOST /api/payment/webhook→ function that processes Stripe notifications
Real example: the site you're reading right now uses Cloudflare Workers for the contact form.
2. Background Processing
Tasks that don't require an immediate response:
- PDF or image generation
- Bulk email sending
- Data processing (import/export, reports)
- System synchronization (ERP ↔ CRM)
3. Cron Jobs (Scheduled Tasks)
Functions executed on a schedule:
- Inventory checks and alerts
- Daily report generation
- Old data cleanup
- Syncing with external APIs
4. Edge Personalization
Code runs before the page reaches the user:
- A/B testing without client-side JavaScript
- Geolocation and localized content
- Rate limiting and bot protection
- Authentication and authorization at the edge
5. AI Inference at the Edge
Cloudflare Workers AI runs machine-learning models on Cloudflare's global network:
- Text/image classification
- Embeddings for search
- Real-time content moderation
Concrete Advantages
Effortless Scaling
Serverless scales automatically. You don't call anyone, you don't provision anything.
Less Maintenance
There's no server to manage. No patching, no "the server went down at 3 AM." The provider handles the infrastructure.
Limitations to Keep in Mind
Cold Starts
AWS documents that Lambda cold-start duration can range from under 100 ms to over one second and that cold starts typically occur in under 1% of invocations. For APIs with strict latency requirements, this can be an issue. Official source: Lambda execution environment lifecycle.
Limited Execution Time
AWS Lambda limits a standard invocation to 15 minutes. Cloudflare Workers limits CPU time to 10 ms on the Free plan, while the Paid plan can be configured up to 5 minutes. Official sources: AWS Lambda quotas and Cloudflare Workers limits.
Harder Debugging
Distributed functions are harder to debug than a monolithic server. You need structured logging, distributed tracing, and dedicated monitoring.
Vendor Lock-In
Each platform has its own APIs and conventions. Migrating between them takes effort. You can minimize lock-in by using standards (Web API, WASM).
State Limitations
Serverless functions are stateless — they don't persist data between executions. You need external storage (databases, cache, object storage).
How We Decide at Brainic
Not every project needs serverless. Our recommendation:
| Situation | Recommendation |
|---|---|
| Static site + forms/simple APIs | Edge functions (Cloudflare Workers) |
| SaaS with complex backend logic | Serverless (Lambda/Cloud Functions) + managed DB |
| Variable or unpredictable traffic | Serverless (automatic scaling) |
| App with global latency requirements | Edge (Workers, Deno Deploy) |
| Existing monolithic backend | Keep it — don't migrate for the sake of trends |
| Heavy processing (video, ML) | Containers (ECS, Cloud Run) — serverless isn't suited |
Serverless and edge computing aren't universal solutions. They're powerful tools when used in the right context.
Want to discuss the right architecture for your project?