Serverless

Serverless (بدون خادم)

Intermediatecloud1 min read
serverless functionsfunction as a servicefaaslambdacloud functionedge function

Definition

A deployment model where code runs in short-lived, auto-scaled function instances rather than on persistent servers.

نموذج نشر يعمل فيه الكود في مثيلات دالة قصيرة الأمد وذاتية التوسع بدلاً من الخوادم الدائمة.

Why It Matters

Every Next.js API route on 404Fault runs as a Vercel serverless function. Understanding cold starts, execution limits, and stateless execution explains why you can't store files on disk or use WebSockets in API routes.

كل مسار API Next.js في 404Fault يعمل كدالة Vercel serverless. فهم البدايات الباردة وحدود التنفيذ والتنفيذ عديم الحالة يُفسّر لماذا لا يمكنك تخزين الملفات على القرص أو استخدام WebSockets في مسارات API.

Full Definition

Serverless computing lets you deploy functions without managing servers. Functions start on demand, run for the duration of a request, and scale automatically to zero when idle. Vercel deploys each Next.js API route as a serverless function. Google Cloud Run (used in 404Fault) also runs containerized code in a serverless manner. You pay per invocation, not for idle servers.
الحوسبة بدون خادم تتيح نشر الدوال دون إدارة الخوادم. تبدأ الدوال عند الطلب وتعمل لمدة الطلب وتتوسع تلقائيًا إلى الصفر عند الخمول. Vercel ينشر كل مسار API Next.js كدالة serverless.

Example Usage

// Each file in /app/api/*/route.ts is a separate Vercel serverless function with its own cold start time and 60s default timeout

// كل ملف في /app/api/*/route.ts هو دالة Vercel serverless منفصلة بوقت بدء بارد خاص بها وانتهاء مهلة افتراضية 60 ثانية

Knowledge Graph

Avoid these mistakes when using Serverless:

1

Storing state in module-level variables — serverless functions may run in different instances for each request

2

Not handling cold start latency for time-sensitive operations

Sign in to unlock guided AI explanations from AI Teacher.

Generate a Prompt

Copy this prompt and use it directly with any AI model — no setup needed.

Ready-to-Use Prompt
Help me build a project using Serverless.

Explain:
1. What is Serverless and why it matters
2. The core architecture and required tools
3. Step-by-step implementation plan
4. Common mistakes to avoid: Storing state in module-level variables — serverless functions may run in different instances for each request, Not handling cold start latency for time-sensitive operations
5. Best practices and production tips

Official Resources