What is a Server?
A server is a computer program or device that provides services, data, or resources to other computers (clients) over a network.
It listens for incoming requests and responds with the appropriate data or action.
-
You (or your application) are the client
-
The server responds to your requests with the data or actions you need
Examples:
-
A web server delivers web pages
-
A file server stores and shares files
-
A database server (like MongoDB) stores and serves data
🔹 Key Points:
-
A server can be software or a physical machine (or both).
-
It waits for client requests and responds — for example, sending a webpage, saving data, or returning search results.
-
Servers are the core of how the internet and modern apps work.
💡 Real-Life Examples of Servers:
Server Type | What It Does | Example |
|---|---|---|
Web Server | Serves web pages | Apache, Nginx, Node.js server |
Database Server | Stores and manages data | MongoDB, MySQL, PostgreSQL |
File Server | Shares files across a network | Windows File Sharing, FTP |
Game Server | Runs multiplayer games | Minecraft server, Counter-Strike |
Email Server | Sends/receives email | Gmail server, SMTP server |
-
A server is just a program or machine that responds to requests.
-
You can run a server on your own computer for web hosting, databases, games, or experiments.
-
Your computer becomes a server as soon as it starts listening for connections and serving responses — even just on
localhost.
How MongoDB Works as a Server
-
MongoDB runs a server process called
mongod. -
This server listens for requests on a network port (default:
27017). -
Applications, tools, or users connect to this server to:
-
Insert data
-
Query collections
-
Perform updates and deletes
-
-
MongoDB Atlas (cloud-hosted MongoDB) also runs this server, just on cloud infrastructure.