Débutant15 min de lecture

What is a Backend?

Understand the client-server model, what a backend does, and why every web application needs one.

The Client-Server Model

Every time you use a website, two computers are having a conversation. Your computer (the client) sends a request, and another computer (the server) sends back a response. This is called the client-server model, and it is the foundation of how the entire internet works.

Think about what happens when you search on Google. You type a query into the search bar and press Enter. Your browser sends that query across the internet to one of Google's servers. The server receives your query, searches through billions of web pages, ranks the results, and sends back an HTML page with your search results. Your browser then displays that page. All of this happens in less than a second.

The same pattern applies everywhere. When you scroll through Instagram, your phone (the client) asks Instagram's servers for the latest posts. The server checks who you follow, gathers recent posts, and sends back the data. When you log into your bank account, the client sends your credentials to the bank's server, which verifies your identity and sends back your account information.

The frontend is everything the user sees and interacts with — the buttons, the layout, the animations. It runs in the browser on the user's device. The backend is the invisible engine behind the scenes — it runs on a server somewhere in a data center, processing requests, managing data, and enforcing rules. Without a backend, a website is just a static brochure. With a backend, it becomes a living, dynamic application.

What Does a Backend Do?

A backend server has four main responsibilities that make web applications actually useful:

1. Store and Retrieve Data (Databases) Almost every application needs to remember things — user accounts, posts, products, orders, messages. The backend connects to a database where all this data is stored permanently. When you create a new account, the backend saves your information. When you log in later, it retrieves that information. Without a backend, there would be no way to persist data between visits.

2. Handle Business Logic (Rules and Calculations) The backend enforces the rules of your application. For an e-commerce site, this means calculating taxes, applying discount codes, checking inventory, and processing payments. For a social media app, it means determining which posts appear in your feed based on an algorithm. These rules are too important and too sensitive to run in the browser where anyone could tamper with them.

3. Authenticate Users (Login and Permissions) The backend manages who can access what. It verifies passwords, creates sessions, and checks permissions. When you log into Netflix, the backend verifies your credentials, checks your subscription tier, and determines which content you can access. A free user and a premium user see different things — the backend enforces this.

4. Serve Content to Clients The backend sends the right content in the right format. For a browser, it might send HTML pages. For a mobile app, it sends JSON data. For a file download, it sends the file bytes. The backend is the single source of truth that all clients connect to — whether that client is a web browser, a mobile app, or another server.

The Client-Server Flow

html
<div style="text-align:center; font-family:sans-serif; padding:20px;">
  <h3>Client-Server Model</h3>
  <div style="display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap;">
    <!-- Client -->
    <div style="border:2px solid #3b82f6; border-radius:8px; padding:16px 24px; background:#eff6ff;">
      <strong>Client</strong><br>(Browser)
      <div style="font-size:12px; color:#666; margin-top:4px;">HTML, CSS, JS</div>
    </div>
    <!-- Arrow right -->
    <div style="font-size:24px;">&#8594;<br><span style="font-size:11px;">HTTP Request</span></div>
    <!-- Server -->
    <div style="border:2px solid #10b981; border-radius:8px; padding:16px 24px; background:#ecfdf5;">
      <strong>Server</strong><br>(Backend)
      <div style="font-size:12px; color:#666; margin-top:4px;">Node.js, Python, etc.</div>
    </div>
    <!-- Arrow right -->
    <div style="font-size:24px;">&#8596;<br><span style="font-size:11px;">Query</span></div>
    <!-- Database -->
    <div style="border:2px solid #f59e0b; border-radius:8px; padding:16px 24px; background:#fffbeb;">
      <strong>Database</strong><br>(Storage)
      <div style="font-size:12px; color:#666; margin-top:4px;">PostgreSQL, MongoDB</div>
    </div>
  </div>
  <div style="margin-top:12px; font-size:24px;">&#8592;<br><span style="font-size:11px;">HTTP Response (HTML, JSON, files)</span></div>
</div>

Frontend vs Backend vs Full-Stack

Now that you understand the client-server model, let's clearly define the three main roles in web development.

Frontend Development focuses on everything the user sees and touches. Frontend developers write HTML for structure, CSS for styling, and JavaScript for interactivity. Their code runs in the browser on the user's device. They care about responsive design, animations, accessibility, and user experience. Tools of the trade include frameworks like React, Vue, or Angular.

Backend Development focuses on everything that happens on the server. Backend developers write the logic that processes requests, interacts with databases, handles authentication, and sends responses. Their code runs on a server in a data center. They care about security, performance, data integrity, and scalability. Languages include Node.js (JavaScript), Python, Java, Go, Ruby, and many others.

Full-Stack Development means working on both sides. A full-stack developer can build the user interface AND the server logic. This is increasingly common, especially with Node.js, which lets you use JavaScript for both frontend and backend.

Here is a quick comparison:

AspectFrontendBackend
Runs onBrowser (user's device)Server (data center)
LanguagesHTML, CSS, JavaScriptNode.js, Python, Java, Go
FocusUI, design, interactivityData, logic, security
Visible to userYesNo
ExampleLogin form layoutPassword verification

In this course, you are about to learn backend development with Node.js — using the JavaScript you already know to build the server side of web applications.

What is the main role of a backend server?

Prêt à pratiquer ?

Crée ton compte gratuit pour accéder à l'éditeur de code interactif, lancer les défis et suivre ta progression.