← Backend← Backend
BackendBackend19 Th7, 2026Jul 19, 202611 phút đọc9 min read

Giới thiệu về BackendIntroduction to Backend Development

Thuộc bộ kiến thức Backend Roadmap.

Tổng quan

Backend development là việc xây dựng phần server-side của phần mềm: code, kho dữ liệu và hạ tầng chạy trên server thay vì chạy trong browser hay mobile app của người dùng. Khi bạn bấm “Mua ngay”, refresh feed, hay đăng nhập, sẽ có một backend nào đó xác thực bạn là ai, kiểm tra tồn kho hay quyền hạn, đọc/ghi database, gọi tới các service khác, rồi trả về một response. Frontend hiển thị kết quả; backend mới là nơi quyết định kết quả đó là gì.

Note này là điểm khởi đầu của toàn bộ Backend Roadmap. Nó giải thích backend làm những gì, một request đi qua một hệ thống điển hình như thế nào, và các phần còn lại của roadmap ghép nối ra sao — để bạn hiểu tại sao sau này phải học HTTP, database, API, caching và deployment.

Vì sao cần backend

Bất cứ thứ gì bạn không thể tin tưởng để client tự làm đúng, an toàn và nhất quán đều thuộc về backend:

Kiến thức nền tảng

Frontend vs backend vs full-stack

Khía cạnhFrontendBackend
Chạy ở đâuThiết bị người dùng (browser, mobile app)Server do bạn kiểm soát
Nhiệm vụ chínhHiển thị, tương tác, UXLogic, dữ liệu, security, tích hợp
Ngôn ngữ phổ biếnJavaScript, TypeScript, Swift, KotlinGo, Python, Java, C#, Node.js, Rust, PHP, Ruby
Nhìn thấyNhững gì người dùng thấyNhững gì người dùng không được thấy (secrets, dữ liệu thô)
Lỗi trông như thế nàoVỡ layout, nút không phản hồiSai dữ liệu, lỗi 500, mất dữ liệu, rò rỉ

Một developer full-stack làm việc ở cả hai phía. Thực tế phần lớn kỹ sư nghiêng về một bên; “full-stack” thường nghĩa là đủ thoải mái ở phía còn lại để làm việc hiệu quả, chứ không phải giỏi ngang nhau ở mọi thứ.

Mô hình client-server

Gần như mọi công việc backend đều theo mô hình client-server: client gửi một request, server xử lý và trả về một response. Client và server là hai chương trình riêng biệt, thường nằm trên các máy khác nhau, giao tiếp qua mạng — phổ biến nhất là qua HTTP trên nền TCP/IP.

Client ↔ Server
Client ↔ Server

Các đặc điểm chính:

Bạn sẽ tìm hiểu sâu hơn về networking và HTTP trong Internet & Web Fundamentals.

Cái gì chạy ở đâu

Frontend (client)                 Backend (server)
─────────────────                 ─────────────────
Render UI                         Business logic / quy tắc
Nhập & validate form (UX)         Validation có thẩm quyền
Routing phía client               API endpoints / routing
Gọi API                           Lưu trữ dữ liệu (DB)
Optimistic updates                Auth & authorization
                                  Tích hợp (email, payments…)
                                  Background jobs & scheduling

Khái niệm chính

Backend thực sự làm những gì

Một backend production chịu trách nhiệm cho một số nhóm việc lặp đi lặp lại:

Giải phẫu một request backend điển hình

Hãy theo một HTTP request — ví dụ GET /api/users/42/orders — đi qua một web application thông thường:

Vòng đời một HTTP request
  1. 01ClientBrowser/app gửi một HTTP request: GET /api/users/42/orders (kèm auth token)
  2. 02DNS + networkDomain phân giải thành IP; request đi qua TCP/TLS.
  3. 03Web server / reverse proxyNginx / load balancer / API gateway kết thúc TLS, định tuyến request tới một application instance.
  4. 04ApplicationFramework khớp route → controller/handler. Middleware chạy: kiểm tra auth, rate limit, logging, validate request.
  5. 05Business logicHandler xác minh user 42 == người gọi (authorization), áp dụng quy tắc, quyết định cần dữ liệu gì.
  6. 06Data layerORM/query gọi database (và/hoặc cache như Redis). SQL: SELECT * FROM orders WHERE user_id=42;
  7. 07Dựng responseCác dòng dữ liệu map thành object → serialize sang JSON. Đặt status code + headers (ví dụ 200 OK).
  8. 08Trả ngược raResponse đi ngược qua proxy về client, và client render.

Một phiên bản tối giản của bước 4–7 bằng Express (Node.js):

// GET /api/users/:id/orders
app.get("/api/users/:id/orders", authenticate, async (req, res) => {
  const userId = Number(req.params.id);

  // Authorization: user chỉ được đọc order của chính mình
  if (req.user.id !== userId) {
    return res.status(403).json({ error: "Forbidden" });
  }

  // Data layer
  const orders = await db.query(
    "SELECT id, total, status, created_at FROM orders WHERE user_id = $1",
    [userId]
  );

  // Response
  return res.status(200).json({ orders });
});

Để ý xem có bao nhiêu chủ đề của roadmap xuất hiện chỉ trong một request: HTTP, routing, middleware, auth, database, caching, serialization và status code. Đó chính là lý do roadmap phải cover tất cả.

Bức tranh công nghệ backend

Hệ sinh thái backend ánh xạ trực tiếp sang các phần sau của roadmap:

TầngVí dụVị trí trong roadmap
Ngôn ngữGo, Python, Java, C#, Node.js/TypeScript, Rust, PHP, RubyProgramming Languages
FrameworkExpress/NestJS, Spring, Django/FastAPI, ASP.NET, Gin, Railsgắn với lựa chọn ngôn ngữ
APIREST, GraphQL, gRPCAPIs
DatabasePostgreSQL, MySQL (relational); MongoDB, Redis (NoSQL)Relational Databases
Web/app serverNginx, Caddy, application runtimeInternet & Web Fundamentals
Caching & messagingRedis, Memcached, Kafka, RabbitMQcác chủ đề sau của roadmap
Hạ tầng (infra)Docker, Kubernetes, CI/CD, cloud (AWS/GCP)giao với phần DevOps & Cloud

Bạn không cần tất cả những thứ này ngay ngày đầu. Hãy chọn một ngôn ngữ, một framework và một relational database, rồi xây một thứ gì đó hoàn chỉnh từ đầu đến cuối trước.

Vai trò & kỹ năng của một backend engineer

Ngoài việc viết code, backend engineer được kỳ vọng biết suy luận về:

Kỹ năng mềm cũng quan trọng: đọc yêu cầu một cách phản biện, trao đổi về các trade-off, và viết code người khác bảo trì được.

Cách tiếp cận việc học

Một thứ tự thực tế bám theo roadmap này:

  1. Học tốt một ngôn ngữ và hiểu internet/HTTP hoạt động ra sao (02, 03).
  2. Xây một CRUD API nhỏ dựa trên một relational database (06, 08).
  3. Thêm authentication, validation và xử lý lỗi.
  4. Học caching, background jobs và testing.
  5. Học deployment — Docker, CI/CD và một cloud provider.
  6. Đi sâu vào scalability, security và system design.

Hãy làm project ở mỗi bước. Chỉ đọc không thôi sẽ không giúp các khái niệm thấm vào bạn.

Coding truyền thống vs coding có AI hỗ trợ

Công việc backend ngày càng diễn ra cùng các AI assistant (code completion, chat, và agent). Sự dịch chuyển này là có thật, nhưng phần nền tảng lại càng quan trọng hơn, chứ không kém đi:

Coding truyền thốngCoding có AI hỗ trợ
Tốc độ bản nháp đầuChậm hơnNhanh hơn nhiều
Boilerplate & code kết dínhViết tayPhần lớn được sinh tự động
Rủi roLỗi con ngườiOutput tự tin nhưng sai, bug tinh vi, default không an toàn
Cái bạn vẫn phải chịu trách nhiệmThiết kế, review, tính đúng đắnThiết kế, review, tính đúng đắn

AI có thể dựng khung một endpoint, phác một query, hay giải thích một stack trace — nhưng nó không thể chịu trách nhiệm cho hệ thống của bạn. Bạn vẫn phải hiểu vòng đời của request, nhận ra một query không an toàn, và đánh giá được một gợi ý có đúng hay không. Hãy dùng AI để đi nhanh hơn với những thứ bạn đã hiểu, và học nhanh hơn với những thứ bạn chưa hiểu; đừng bao giờ ship code mà bạn không giải thích được. Xem thêm trong AI for Backend.

Best Practices

Tài liệu tham khảo

Part of the Backend Roadmap knowledge base.

Overview

Backend development is the practice of building the server-side of software: the code, data stores, and infrastructure that run on servers rather than in the user’s browser or mobile app. When you tap “Buy now”, refresh a feed, or log in, a backend somewhere validates who you are, checks inventory or permissions, reads and writes to a database, talks to other services, and sends back a response. The frontend renders the result; the backend decides what the result is.

This note is the entry point to the whole Backend Roadmap. It explains what a backend does, how a single request flows through a typical system, and how the rest of the roadmap fits together — so you know why you’re later learning HTTP, databases, APIs, caching, and deployment.

Why the backend exists

Anything you cannot trust the client to do correctly, safely, or consistently belongs on the backend:

Fundamentals

Frontend vs backend vs full-stack

AspectFrontendBackend
Runs onUser’s device (browser, mobile app)Servers you control
Primary jobPresentation, interaction, UXLogic, data, security, integration
Typical languagesJavaScript, TypeScript, Swift, KotlinGo, Python, Java, C#, Node.js, Rust, PHP, Ruby
SeesWhat the user seesWhat the user must not see (secrets, raw data)
Failure looks likeBroken layout, unresponsive buttonWrong data, 500 error, data loss, breach

A full-stack developer works across both. In practice most engineers lean one way; “full-stack” usually means comfortable enough on the other side to be productive, not equally expert at everything.

The client-server model

Almost all backend work follows the client-server model: a client sends a request, a server processes it and returns a response. The client and server are separate programs, usually on different machines, communicating over a network — most often via HTTP over TCP/IP.

Client ↔ Server
Client ↔ Server

Key properties:

You’ll go deeper on networking and HTTP in Internet & Web Fundamentals.

What runs where

Frontend (client)                 Backend (server)
─────────────────                 ─────────────────
UI rendering                      Business logic / rules
Form input & validation (UX)      Authoritative validation
Client-side routing               API endpoints / routing
Calling APIs                      Data persistence (DB)
Optimistic updates                Auth & authorization
                                  Integrations (email, payments…)
                                  Background jobs & scheduling

Key Concepts

What a backend actually does

A production backend is responsible for a handful of recurring concerns:

Anatomy of a typical backend request

Follow one HTTP request — say GET /api/users/42/orders — through a conventional web application:

Life of an HTTP request
  1. 01ClientBrowser/app sends an HTTP request: GET /api/users/42/orders (with an auth token)
  2. 02DNS + networkDomain resolves to an IP; request travels over TCP/TLS.
  3. 03Web server / reverse proxyNginx / load balancer / API gateway terminates TLS, routes the request to an application instance.
  4. 04ApplicationFramework matches the route → controller/handler. Middleware runs: auth check, rate limit, logging, request validation.
  5. 05Business logicHandler verifies user 42 == caller (authorization), applies rules, decides what data is needed.
  6. 06Data layerORM/queries hit the database (and/or a cache like Redis). SQL: SELECT * FROM orders WHERE user_id=42;
  7. 07Response builtRows mapped to objects → serialized to JSON. Status code + headers set (e.g. 200 OK).
  8. 08Back outResponse passes back through proxy to the client, which renders it.

A minimal version of steps 4–7 in Express (Node.js):

// GET /api/users/:id/orders
app.get("/api/users/:id/orders", authenticate, async (req, res) => {
  const userId = Number(req.params.id);

  // Authorization: users may only read their own orders
  if (req.user.id !== userId) {
    return res.status(403).json({ error: "Forbidden" });
  }

  // Data layer
  const orders = await db.query(
    "SELECT id, total, status, created_at FROM orders WHERE user_id = $1",
    [userId]
  );

  // Response
  return res.status(200).json({ orders });
});

Notice how many roadmap topics appear in one request: HTTP, routing, middleware, auth, databases, caching, serialization, and status codes. That is why the roadmap covers them all.

The backend tech landscape

The backend ecosystem maps directly onto later roadmap sections:

LayerExamplesWhere in the roadmap
LanguagesGo, Python, Java, C#, Node.js/TypeScript, Rust, PHP, RubyProgramming Languages
FrameworksExpress/NestJS, Spring, Django/FastAPI, ASP.NET, Gin, Railstied to your language choice
APIsREST, GraphQL, gRPCAPIs
DatabasesPostgreSQL, MySQL (relational); MongoDB, Redis (NoSQL)Relational Databases
Web/app serversNginx, Caddy, application runtimesInternet & Web Fundamentals
Caching & messagingRedis, Memcached, Kafka, RabbitMQlater roadmap topics
InfrastructureDocker, Kubernetes, CI/CD, cloud (AWS/GCP)overlaps the DevOps & Cloud sections

You do not need all of these on day one. Pick one language, one framework, and one relational database, and build something end to end first.

Roles & skills of a backend engineer

Beyond writing code, backend engineers are expected to reason about:

Soft skills matter too: reading requirements critically, communicating trade-offs, and writing code others can maintain.

How to approach learning

A practical order that mirrors this roadmap:

  1. Learn one language well and how the internet/HTTP works (02, 03).
  2. Build a small CRUD API backed by a relational database (06, 08).
  3. Add authentication, validation, and error handling.
  4. Learn caching, background jobs, and testing.
  5. Learn deployment — Docker, CI/CD, and a cloud provider.
  6. Go deep on scalability, security, and system design.

Build projects at every step. Reading alone will not make the concepts stick.

Traditional coding vs AI-assisted coding

Backend work increasingly happens with AI assistants (code completion, chat, and agents). The shift is real but the fundamentals matter more, not less:

Traditional codingAI-assisted coding
Speed of a first draftSlowerMuch faster
Boilerplate & glue codeManualLargely generated
RiskHuman errorConfident but wrong output, subtle bugs, insecure defaults
What you still must ownDesign, review, correctnessDesign, review, correctness

AI can scaffold an endpoint, draft a query, or explain a stack trace — but it cannot be accountable for your system. You still must understand the request lifecycle, spot an insecure query, and judge whether a suggestion is correct. Use AI to go faster on things you already understand and to learn faster on things you don’t; never ship code you can’t explain. More in AI for Backend.

Best Practices

References