create-a-backend

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Create 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

产品映射

NeedVercel product
HTTP APIs, webhooks, streaming, or framework server codeVercel 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 togetherVercel Services
An existing Dockerfile, custom runtime, or system dependenciesContainer images on Vercel Functions, optionally composed with Services
Durable multi-step work with retries, sleeps, or external eventsVercel Workflow
Background jobs, buffering, fan-out, or direct message routingVercel Queues
Scheduled HTTP workVercel Cron Jobs; use Workflow when the job itself must be durable
Postgres, Redis, NoSQL, vector, or other application dataStorage integrations from the Vercel Marketplace
Files and user uploadsVercel Blob
Global, read-heavy configurationEdge 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
    app
    , with additional configuration as needed.
  • 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

工作流程

  1. Identify synchronous requests, asynchronous work, persistent data, and independently deployed components.
  2. Select the products from the map, then select the framework.
  3. Load the focused skill for implementation:
    vercel-functions
    ,
    vercel-services
    ,
    workflow
    ,
    vercel-storage
    , or
    marketplace
    .
  4. Confirm function limits, regions, environment variables, observability, and current product availability in the official docs before deployment.
  1. 识别同步请求、异步任务、持久化数据和独立部署的组件。
  2. 从产品映射中选择产品,然后选择框架。
  3. 加载用于实现的专项技能:
    vercel-functions
    vercel-services
    workflow
    vercel-storage
    marketplace
  4. 部署前在官方文档中确认函数限制、区域、环境变量、可观测性以及当前产品的可用性。