Every edge function is a
complete backend.
Serverless functions with a database, cache, queue, AI, vector search, and storage as native bindings. Not HTTP calls. Zero latency. Zero config.
Traditional serverless = function + 7 external services.
Traditional serverless
Aerostack edge functions
8 native bindings. Zero setup.
Every Cloudflare edge function gets access to the full primitive stack — injected at runtime, no credentials, no connection strings.
Database
env.DB SQL queries, batch operations, prepared statements. SQLite-compatible via Cloudflare D1.
Cache
env.CACHE Key-value storage with TTL, atomic counters, list operations. In-memory speed at the edge.
Queue
env.QUEUE Background jobs with retries, status tracking, and dead-letter handling. Fire and forget.
AI Runtime
env.AI On-edge LLM inference, embeddings, and streaming. Multi-provider — OpenAI, Anthropic, and more.
Vector Search
env.VECTORIZE Semantic similarity search, RAG pipelines, automatic embedding generation.
Storage
env.STORAGE Object storage with CDN delivery and zero egress fees. Upload, serve, and manage files.
Durable Objects
env.DO Strongly-consistent coordinated state. WebSockets, counters, locks — all without a separate database.
Hyperdrive
env.HYPERDRIVE Pooled, low-latency connections to your existing Postgres or MySQL. No connection-string management.
AI built into every function.
Aerostack edge functions include the Cloudflare AI runtime as a native binding — not a third-party API call with latency and key management overhead. Call env.AI.run() directly in your handler for on-edge inference, embeddings, and streaming responses.
- On-edge inference — model runs at the same location as your code
- Multi-provider: OpenAI, Anthropic, Workers AI, and more
- Embeddings generated and stored in env.VECTORIZE in one call
- Streaming responses with no extra infrastructure
- 500 K inference tokens free per month on every account
export default {
async fetch(req: Request, env: Env) {
const { query } = await req.json()
// Generate embedding — native, zero latency
const { data: [vec] } = await env.AI.run(
'@cf/baai/bge-base-en-v1.5',
{ text: [query] }
)
// Semantic search in Vectorize
const { matches } = await env.VECTORIZE
.query(vec.values, { topK: 5 })
// Generate answer with context
const answer = await env.AI.run(
'@cf/meta/llama-3.3-70b-instruct-fp8-fast',
{ messages: [{ role: 'user',
content: `Answer using: ${matches}` }] }
)
return Response.json(answer)
}
} Edge functions vs serverless functions — what actually differs.
"Serverless" and "edge" are often used interchangeably. They are not the same thing — and the difference compounds as your workload grows.
| Dimension | Traditional serverless (Lambda, Cloud Functions) | Aerostack edge functions (Cloudflare Workers) |
|---|---|---|
| Execution location | 1–4 regional data centres | 300+ global edge locations — closest to user |
| Cold start | 100ms–3s (worse in VPCs) | Zero — V8 isolates, no container spin-up |
| Data layer | External HTTP calls to DB, cache, queue | 8 native bindings — in-process, zero network hop |
| AI inference | External API call + key management | env.AI — on-edge, same process as your code |
| Latency baseline | Function RTT + up to 6 service RTTs | Function RTT only — all primitives are in-process |
| Auth & rate limits | Custom middleware or separate API gateway | One-click gateway — auto key, rate limits, analytics |
| Agent integration | HTTP endpoint only | Native MCP tool — callable by name from any AI agent |
The comparison that matters for AI workloads: edge functions keep all data operations in-process. Serverless functions make each one a round-trip.
Write once, run anywhere.
OFS functions declare their dependencies in a manifest — the runtime injects them. The same function runs locally on Node.js or Bun with mock bindings during development, and on Cloudflare Workers in production. No vendor lock-in.
Unlike Supabase (Deno-only) or Netlify (Node-only), an OFS function is not
tied to one runtime. Declare what your function needs in
aerostack.json
and the platform provides it — whether that's the real Cloudflare bindings in
production or compatible mock adapters when you run locally.
This means you can develop and test functions on your laptop without
deploying to the edge first, then ship to 300+ Cloudflare locations with
a single command. The local mock injects sdk.db,
sdk.cache, and
every other binding using the same interface the edge runtime uses.
One function. Full backend.
export default {
async fetch(request: Request, env: Env) {
// Query database — native binding, not HTTP
const orders = await env.DB.prepare(
'SELECT * FROM orders WHERE user_id = ?'
).bind(userId).all()
// Cache the result with TTL
await env.CACHE.put('recent-orders', JSON.stringify(orders),
{ expirationTtl: 3600 })
// Queue a background notification
await env.QUEUE.send({ type: 'order-summary', userId })
// AI analysis
const summary = await env.AI.run('...', { messages: [...] })
return Response.json({ orders, summary })
}
} Four bindings. One function. No infrastructure to manage.
Expose any function as an MCP tool.
Deploy a function, link it to an MCP server, and every AI agent in your workspace can call it by name — no HTTP URL, no auth plumbing. Supabase and Netlify give you an endpoint; Aerostack gives you a named, agent-callable capability.
// Deploy the function, then link it to an MCP server
aerostack fn deploy lookup-order
aerostack mcp add-tool lookup-order
// Agents now call it by name with a typed schema Two ways to ship a serverless function.
Deploy a raw function for a public URL, or deploy with a gateway to add API keys, rate limits, and analytics in one click.
Function only
Public URL · instant- signal Deploys to a Cloudflare Worker in roughly 30 seconds
- signal Returns a public function URL immediately
- signal No auth, no setup — ideal for prototypes and internal tools
Function + gateway
One click · managed- signal Auto-generates a consumer API key for the function
- signal Adds rate limiting and a starter usage plan
- signal Turns on request analytics and logs — no middleware to write
Build anything. All at the edge.
Custom API Backend
Build REST or GraphQL APIs with database, auth, and caching built in. Ship a complete backend in a single file.
Bot Intelligence Layer
Power AI bots with persistent memory, RAG over your data, and real-time tool execution at the edge.
RAG Pipeline
Ingest documents, generate embeddings, store vectors, and serve semantic search — all from one function.
Real-time Data Pipeline
Process webhooks, transform data, queue background jobs, and write results to database — with zero infrastructure.
Functions power everything.
Edge functions are the foundation layer. Every MCP server, skill, bot workflow, and agent endpoint runs on top of the same fullstack runtime.
Related features
Start building Cloudflare edge functions — all 8 primitives included.
Database, cache, queue, AI runtime, vector search, storage, Durable Objects, and Hyperdrive — every serverless function ships with the full stack, globally deployed in 30 seconds.