> For the complete documentation index, see [llms.txt](https://blockchain-journal-hope-mabuza.gitbook.io/blockchain-journal-hope-mabuza-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blockchain-journal-hope-mabuza.gitbook.io/blockchain-journal-hope-mabuza-docs/backend/why-we-need-servers-in-web3-apps.md).

# Why we need Servers in Web3 apps?

The first time I actually paid attention to the server concept was during one of our sessions at Africa's Blockchain Club. One of the developers was demonstrating his lottery dApp and someone asked him what server he was running his application on. I was so confused. I had heard the term before during a group project in my time as a student at WeThinkCode, but never thought much about it. A server is a program that listens for requests from a client and sends back a response, and I never really questioned why that mattered in web3.

My first instinct was: why do we even need servers in web3? We have smart contracts with logic, and the frontend can communicate with the contract directly, with the blockchain even. I thought servers were a web2 thing. But as I started working on real web3 projects, that thinking got corrected fast. Turns out web2 and web3 are not completely separate worlds, they work together constantly. The difference is mostly in the libraries and infrastructure, not the concepts.

Here is how the server responsibilities compare between web2 and web3:

<figure><img src="/files/9uB3COQBl2m9DxGeh9Ur" alt=""><figcaption></figcaption></figure>

* **Hosting the app / Hosting the dApp UI**&#x20;
  * Both Web2 and Web3 need somewhere to serve the frontend to users. In Web2 it's a regular website. In Web3 it's your dApp, but it still needs a host like Vercel or Netlify. Same job, different name.
* **Database / Data indexing**&#x20;
  * Web2 stores everything in a database like PostgreSQL. Web3 can't query the blockchain efficiently like a database, so a server indexes the blockchain data first and stores it somewhere it can be searched quickly.
* **Business logic / Off-chain logic**&#x20;
  * Web2 runs all its rules and calculations on the server. Web3 can run logic on the blockchain through smart contracts, but it's expensive, so heavy or sensitive logic is moved off-chain to a regular server instead.
* **External API calls / Oracle / data feed**&#x20;
  * Web2 servers freely call external APIs for things like weather or payments. Smart contracts can't do this, they're isolated. So an oracle is a server that fetches real world data and feeds it into the blockchain on their behalf.
* **Push notifications / Event listener**&#x20;
  * Web2 servers send emails, alerts, and webhooks when something happens. Blockchains can't do this either, they don't push anything. So a server constantly listens for smart contract events and triggers those notifications when something happens on-chain.
* **Auth server / RPC node**&#x20;
  * Web2 uses an auth server to manage who you are, logins, sessions, tokens. Web3 uses an RPC node as the gateway into the blockchain. Every time your app reads or writes data to the blockchain, it goes through an RPC node like Infura or Alchemy.

Most Web3 apps are actually hybrid apps. For example:

A typical dApp will use an **RPC node** to talk to the blockchain, but still use a **PostgreSQL database** to store user profiles. It will use **wallet login** to authenticate users, but still issue a **JWT token** (classic Web2 auth) to manage the session. It will store important metadata on **IPFS**, but still use **AWS S3** for regular images because it's faster and cheaper. It will listen for **smart contract events** on-chain, but still use **SendGrid** to send the email notification.

So in practice you're rarely choosing between Web2 and Web3 infrastructure, you're combining both. The blockchain handles the parts that need to be trustless, transparent, and permanent. Regular Web2 servers handle everything that needs to be fast, flexible, and cheap.

Think of it this way: Web3 doesn't replace your Web2 backend, it just adds a new layer to it. Most blockchain developers write more Express.js, SQL, and REST APIs on a daily basis than they write Solidity. The Web2 foundation is still very much there, the blockchain just sits on top of it where it's needed.
