Skip to content

Backend framework

Introduction

Choosing a backend framework sets the default path for routes, middleware, and ecosystem pieces; how much comes built-in varies, and many later components follow that choice.

How to choose

  1. Pick the language first: language is usually decided by team skills, and it is the premise for almost every later component choice. In the architecture diagram, choose a language first so the framework list is filtered accordingly.
    • Python: broad ecosystem and fast to ship; a natural fit for AI and data work; fill in types with mypy.
    • C#: strong typing, good performance, complete tooling.
    • Rust: memory safety and performance, shippable as one binary; compiles are slow, and ORM and auth are chosen separately (often Axum with SQLx).
    • Go: simple to deploy, concurrency-friendly, strong standard library; the ecosystem leans toward “assemble it yourself”.
    • TypeScript: one language for frontend and backend; Next.js and Nuxt can go full-stack; the dependency ecosystem moves fast, so lean on strict mode and runtime validation.
  2. Do you need a ready-made admin: internal management systems need lots of CRUD screens; Django’s built-in admin saves a lot of time; NestJS and Axum fill the gap with ecosystem libraries.
  3. APIs or pages: if you mainly serve mini programs, apps, or a frontend, pick an API-first framework (FastAPI, Fastify, Axum, Gin, and so on); if the backend also renders pages, see “server-side rendering” and “full-stack frameworks” under UI approach.
  4. Team size: with more people, favor frameworks with stronger conventions (Django, ASP.NET Core Controllers, NestJS); with fewer people, favor lighter frameworks (FastAPI, Axum, chi).

Component comparison

ASP.NET Core Minimal API

Official frameworkOpen sourceOpsLow

Microsoft's official web API framework: wire "URL → handler function" with minimal code. The preferred style for new projects.

Best forNew small and mid-sized API services, mini-program / app backends.

Avoid whenThe team has a lot of existing Controllers code to keep, or must standardize on traditional MVC.

Pros

Little code: one file is enough to get an API running

It starts quickly and works well with EF Core and dependency injection

Official docs and samples mostly use this style

Cons

As the project grows, you must decide the folders and the grouping

People used to the controller style have to adapt

It runs only on .NET, so the hiring pool is narrower

  • C# integrationWebApplication.CreateBuilder + MapGroup

Official docs ↗

ASP.NET Core Controllers

Official frameworkOpen sourceOpsLow

The traditional "controller" style: one class manages a set of endpoints, with many conventions and a uniform standard, widely used by large teams.

Best forLarge and mid-sized projects with many collaborators, where the team already knows the MVC style.

Avoid whenSmall projects with one or two people and few endpoints.

Pros

The most documentation and ready-made experience; easy for newcomers

Mature filters, model validation and routing conventions make it easy to standardize across a team

Structure is naturally clear in large projects

Cons

More boilerplate than Minimal API

Feels verbose for small projects

Slightly higher startup time and memory usage

  • C# integrationAddControllers + [ApiController]

Official docs ↗

FastAPI

Open sourceOpsLow

A modern Python API framework: write typed functions, and docs and parameter validation are generated automatically.

Best forAPI services, mini-program / app backends, AI applications.

Avoid whenYou want an out-of-the-box admin and user system, or most pages are rendered directly on the server.

Pros

It generates interactive OpenAPI docs automatically

Pydantic validation keeps bad data out

Native async with strong performance, and the usual choice for new projects

Cons

No database, users, or admin; you assemble those yourself

Larger projects lack a folder convention, so the team must set one

The version is still 0.x, so read the notes before upgrading

  • Python integrationfastapi + uvicorn

Official docs ↗

Django

Open sourceOpsLow

A "batteries-included" Python framework: database, user login and an admin interface are all built in.

Best forInternal management systems, content websites, projects that want an admin interface quickly.

Avoid whenMinimal microservices, or scenarios that are almost entirely high-concurrency async APIs.

Pros

Built-in ORM, database migrations, user authentication and admin site; the fastest way to build back-office systems

Fairly complete secure defaults (CSRF, XSS protection, etc.)

Over a decade of accumulation; mature ecosystem and documentation

Cons

Heavyweight: for a pure API you need to add Django REST Framework or django-ninja

Async support is less thorough than FastAPI

Many conventions; takes time to learn at first

  • Python integrationdjango + djangorestframework

Official docs ↗

Flask

Open sourceOpsLow

A very light Python framework that only handles "receive request, return result"; you pick the other parts yourself.

Best forSmall services, internal tools, quick prototypes.

Avoid whenLarge projects that need a full admin and long-term multi-person collaboration.

Pros

Few concepts; you can have a working API in half a day

The structure is free, and folders can be split however you like

A good fit for small tools, prototypes, and internal scripts

Cons

Database, validation, and auth all have to be chosen by you

As it grows there is no shared convention, so teamwork gets messy

Async support and automatic docs are both weaker than FastAPI

  • Python integrationflask

Official docs ↗

Fastify

Open sourceOpsLow

A high-performance Node.js API framework with built-in JSON Schema validation and a plugin system.

Best forAPI services, mini-program / app backends, BFF.

Avoid whenLarge multi-person projects that need strong conventions (consider NestJS).

Pros

Among the faster Node frameworks

Route-level schema validation and serialization, type-friendly with TypeBox / zod

Clean plugin encapsulation and a mature ecosystem

Cons

No built-in ORM, auth or admin; you must assemble them yourself

No strongly conventional directory structure; large projects need team-defined rules

The plugin encapsulation model has a learning curve at first

  • TypeScript integrationfastify + @fastify/*

Official docs ↗

NestJS

Open sourceOpsLow

A Node framework with strong conventions, modularity and complete dependency injection, similar in style to ASP.NET.

Best forMid-to-large API services, management systems and e-commerce backends with many collaborators.

Avoid whenSmall services with one or two people, or lightweight APIs in a more functional style.

Pros

Complete conventions for modules, dependency injection, guards and interceptors, suited to multi-person collaboration

Mature integration with OpenAPI, validation and ORMs

Uniform structure, so AI-generated code has a consistent style

Cons

Lots of boilerplate and decorators; feels heavy for small projects

Many abstraction layers raise the bar for debugging and performance tuning

Steeper learning curve than Fastify / Hono

  • TypeScript integration@nestjs/*

Official docs ↗

Hono

Open sourceOpsLow

An extremely lightweight web-standards framework; the same code runs on Node, Bun, Cloudflare Workers and other runtimes.

Best forAPIs on serverless / edge deployments, lightweight BFF.

Avoid whenLarge team projects that need strong conventions, or projects relying on many Node-only libraries.

Pros

Small and fast to start, suited to edge and serverless

Built on web-standard APIs, so migrating runtimes is cheap

Built-in type-safe RPC client and validation middleware

Cons

Smaller ecosystem and fewer resources than Fastify / NestJS

No built-in layering conventions or admin capabilities

Little advantage in traditional long-running processes

  • TypeScript integrationhono + @hono/zod-validator

Official docs ↗

Next.js full-stack (React)

Open sourceOpsMedium

Use Next.js for both the UI and the server-side API: one project, one language, no separate frontend.

Best forProducts where one team owns both UI and API and that need search-engine indexing: SaaS, content and e-commerce storefronts.

Avoid whenThe backend must be shared by multiple clients (apps, mini-programs), or there are many background tasks and complex domain logic (consider a separate backend).

Pros

Frontend and backend share one project and one set of types, so iteration is fast

Server rendering and routing are built in, which helps search indexing

You can deploy on Vercel, or host Node yourself

Cons

Business logic easily scatters across route handlers, so you must layer it

Long jobs, scheduled jobs, and message consumers need a separate process

Server components and caching are many concepts, and versions change a lot

  • TypeScript integrationnext

Official docs ↗

Nuxt full-stack (Vue)

Open sourceOpsMedium

Use Nuxt for both the UI and the server-side API (Nitro): one project, one language, no separate frontend.

Best forProducts where the team knows Vue and one team owns both UI and API.

Avoid whenThe backend must be shared by multiple clients, or there is complex domain logic.

Pros

One project for frontend and backend, and the Vue ecosystem is easy to learn

Server rendering is built in, and the folder conventions are fairly clear

Nitro can be deployed to several runtime platforms

Cons

Logic easily scatters across server endpoints, so layering has to be enforced

Long jobs and scheduled jobs still need a separate process

The ecosystem and the hiring pool are both smaller than Next.js

  • TypeScript integrationnuxt

Official docs ↗

Axum

Open sourceOpsLow

A Rust web framework on Tokio: type-safe extractors plus Tower middleware, the usual choice for new projects.

Best forNew small and mid-sized API services, admin systems, and shop backends.

Avoid whenThe team has no Rust experience, or you need an admin UI out of the box.

Pros

The type system catches parameter and error mistakes at compile time

Fits the Tokio and Tower ecosystem, with a mature async runtime

Widely used for new projects, with solid docs and examples

Cons

Compiles are slow; a one-line change means waiting

No built-in ORM, auth, or admin; you assemble them

Ownership and lifetimes are a steep step for teams new to Rust

  • Rust integrationaxum + tower-http + tokio

Official docs ↗

Actix Web

Open sourceOpsLow

A Rust web framework oriented toward actors and throughput, a performance-minded alternative to Axum.

Best forThroughput-sensitive API services, and teams that already know Actix.

Avoid whenYou want to stay aligned with Tokio and Tower middleware (choose Axum).

Pros

Throughput and latency stay near the front of Rust web frameworks

Mature middleware, extractors, and test utilities

A good fit for teams that already know Actix

Cons

The runtime model is a different mental model from the Tokio ecosystem

Fewer guides and examples than Axum

The actor style can couple business code to the framework

  • Rust integrationactix-web

Official docs ↗

net/http + chi

Open sourceOpsLow

The standard library plus a lightweight router: the "few dependencies" approach most favored by the Go community.

Best forAPI services, mini-program / app backends, microservices.

Avoid whenYou need an out-of-the-box admin and user system.

Pros

Almost entirely standard library: few dependencies and stable upgrades

Fully compatible with net/http, so the middleware ecosystem is interchangeable

Clear structure that is easy to maintain long term

Cons

Validation, auth and ORM must all be chosen and assembled yourself

No unified project structure; the team must agree on one

More boilerplate than batteries-included frameworks

  • Go integrationchi + net/http

Official docs ↗

Gin

Open sourceOpsLow

The most popular web framework in Go, with routing, parameter binding, validation and middleware all included.

Best forAPI services that need a quick start, teams that already have Gin experience.

Avoid whenYou want the fewest dependencies, or need full compatibility with standard-library middleware.

Pros

Quick to learn, with the most docs and samples in the Go world

Parameter binding and request validation are ready to use

Runtime performance is good, and ready-made middleware is plentiful

Cons

The framework Context is not fully interchangeable with the standard library

Folder structure and layering are still for the team to decide

It is easy to pile business logic inside the handlers

  • Go integrationgin-gonic/gin

Official docs ↗

Checklist

  • A framework is explicitly chosen, instead of letting the AI decide afresh each time
  • The reasons are clear (team familiarity, need for an admin, multi-person collaboration)
  • Both the framework and the runtime versions are still maintained
  • The directory layout follows a shared convention and is written into the project docs
  • Known limitations (see each component’s “cons” above) have matching mitigations