create-a-backend
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreate a Backend
创建后端
Help the user create a backend by choosing an architecture before reaching for implementation details. Start from the workload, not the programming language. Vercel runs complex backend applications, not just frontends.
帮助用户在考虑实现细节之前先选择架构来创建后端。从工作负载出发,而非编程语言。Vercel不仅能运行前端,还能运行复杂的后端应用。
Product map
产品映射
| Need | Vercel product |
|---|---|
| HTTP APIs, webhooks, streaming, or framework server code | Vercel Functions with Fluid compute |
| Bidirectional realtime connections (WebSockets) | Vercel Functions with Fluid compute; no separate realtime service required |
| A frontend and one or more backends (API endpoints) that deploy together | Vercel Services |
| An existing Dockerfile, custom runtime, or system dependencies | Container images on Vercel Functions, optionally composed with Services |
| Durable multi-step work with retries, sleeps, or external events | Vercel Workflow |
| Background jobs, buffering, fan-out, or direct message routing | Vercel Queues |
| Scheduled HTTP work | Vercel Cron Jobs; use Workflow when the job itself must be durable |
| Postgres, Redis, NoSQL, vector, or other application data | Storage integrations from the Vercel Marketplace |
| Files and user uploads | Vercel Blob |
| Global, read-heavy configuration | Edge Config |
Use Functions for the normal request/response backend. Use Services when independently built components should share one deployment, routing layer, preview URL, and rollback. Use separate Vercel projects when components need independent release cycles.
Prefer a native Functions runtime for supported frameworks. Use container images when the application already has a Dockerfile or requires a custom runtime or system dependencies. They run as autoscaling, stateless Functions rather than always-on container hosts.
Choose Queues for background jobs, buffering, fan-out, and message routing. Choose Workflow for durable multi-step business logic.
| 需求 | Vercel产品 |
|---|---|
| HTTP API、Webhook、流处理或框架服务端代码 | Vercel Functions with Fluid compute |
| 双向实时连接(WebSockets) | Vercel Functions with Fluid compute;无需单独的实时服务 |
| 需一起部署的前端和一个或多个后端(API端点) | Vercel Services |
| 现有Dockerfile、自定义运行时或系统依赖 | Vercel Functions上的容器镜像,可选择与Services组合使用 |
| 具备重试、休眠或外部事件的持久化多步骤任务 | Vercel Workflow |
| 后台任务、缓冲、扇出或直接消息路由 | Vercel Queues |
| 定时HTTP任务 | Vercel Cron Jobs;若任务本身需要持久化,则使用Workflow |
| Postgres、Redis、NoSQL、向量数据库或其他应用数据 | Vercel Marketplace的存储集成 |
| 文件与用户上传 | Vercel Blob |
| 全局、读密集型配置 | Edge Config |
常规请求/响应后端使用Functions。当独立构建的组件需要共享同一部署、路由层、预览URL和回滚机制时,使用Services。当组件需要独立的发布周期时,使用单独的Vercel项目。
对于受支持的框架,优先选择原生Functions运行时。当应用已有Dockerfile或需要自定义运行时/系统依赖时,使用容器镜像。它们以自动扩缩容的无状态Functions形式运行,而非始终在线的容器主机。
后台任务、缓冲、扇出和消息路由选择Queues。持久化多步骤业务逻辑选择Workflow。
Databases and data stores
数据库与数据存储
Provision data stores through the Marketplace so credentials are injected into the project and environments stay connected. Check the current catalog before choosing a provider.
- Postgres: Neon, Supabase, AWS/Aurora, Nile, Prisma
- MySQL: AWS/Aurora
- Redis and key-value: Upstash, Redis
- Document and NoSQL: MongoDB Atlas, AWS
- SQLite: Turso
- Realtime application backend: Convex
- Analytics: MotherDuck
Keep the database close to the Functions region and use a serverless-compatible connection or pool.
通过Marketplace配置数据存储,以便将凭据注入项目并保持环境连接。选择提供商前请查看当前目录。
- Postgres: Neon、Supabase、AWS/Aurora、Nile、Prisma
- MySQL: AWS/Aurora
- Redis与键值存储: Upstash、Redis
- 文档型与NoSQL: MongoDB Atlas、AWS
- SQLite: Turso
- 实时应用后端: Convex
- 分析: MotherDuck
保持数据库与Functions区域接近,并使用兼容无服务器的连接或连接池。
Backend frameworks
后端框架
Vercel provides first-class backend examples and integrations for these frameworks:
- Node.js and TypeScript: Elysia, Express, Fastify, H3, Hono, Koa, NestJS, Nitro, and xmcp. Next.js Route Handlers are the natural choice when the backend belongs to a Next.js application.
- Python: FastAPI, Flask, and Django. Other WSGI or ASGI applications can run when they export a compatible , with additional configuration as needed.
app - Go: supported as a Vercel Functions runtime.
Frontend and backend combinations, for example a Next.js/Vite/SvelteKit frontend with a FastAPI/Flask/Express/Go backend, can be deployed together in one project using Services.
Prefer the user's existing framework. For a new project, choose based on ecosystem and application needs.
Vercel为以下框架提供一流的后端示例和集成:
- Node.js与TypeScript: Elysia、Express、Fastify、H3、Hono、Koa、NestJS、Nitro和xmcp。当后端属于Next.js应用时,Next.js Route Handlers是自然之选。
- Python: FastAPI、Flask和Django。其他WSGI或ASGI应用在导出兼容的后即可运行,必要时需额外配置。
app - Go: 作为Vercel Functions运行时受支持。
前端与后端组合(例如Next.js/Vite/SvelteKit前端搭配FastAPI/Flask/Express/Go后端)可通过Services在一个项目中一起部署。
优先选择用户现有的框架。对于新项目,根据生态系统和应用需求进行选择。
Work sequence
工作流程
- Identify synchronous requests, asynchronous work, persistent data, and independently deployed components.
- Select the products from the map, then select the framework.
- Load the focused skill for implementation: ,
vercel-functions,vercel-services,workflow, orvercel-storage.marketplace - Confirm function limits, regions, environment variables, observability, and current product availability in the official docs before deployment.
- 识别同步请求、异步任务、持久化数据和独立部署的组件。
- 从产品映射中选择产品,然后选择框架。
- 加载用于实现的专项技能:、
vercel-functions、vercel-services、workflow或vercel-storage。marketplace - 部署前在官方文档中确认函数限制、区域、环境变量、可观测性以及当前产品的可用性。