Back

Who's Serving Who? The Code vs. The Machine

06 Sep 2024

main image for Who's Serving Who? The Code vs. The Machine

As a web developer, you often come across the word server, and it can mean different things depending on the context. This can get confusing. Like Abbott and Costello asking “Who’s on first?” or Aretha Franklin wondering “Who’s Zoomin’ Who?”, we ask ourselves: Who’s serving what to where?

It’s funny while dining at my favorite restaurant, I found myself having a discussion with my server. I said, “Let’s clarify the key difference between programming a server in code and the physical machine we call a server!” She furrowed her brow and replied, “I asked what you’d like to drink.”

For beginners, it’s easy to get lost. And honestly, even for seasoned developers, the term can still be misleading at times.

Waiting server illustration

1. The Physical Machine (Hardware / Cloud Server)

A server is a physical machine that provides resources to other computers. It may live in a data center or exist as a virtual server provisioned in the cloud. Either way, it typically runs 24/7 to serve files or data to the web, whether on-premises or in massive data centers managed by AWS, Google Cloud, or Microsoft Azure.

To deliver content, these physical servers rely on software like Apache or Nginx, which handle incoming requests and send the appropriate data to users.

After a volleyball game, a teammate and I were discussing his confusion about what Node.js is. Man, he’s a strong server. I explained that in programming, a server can also refer to software that listens for requests and responds to them. A server within a server, so to speak. Server-ception.

Serverception visual

2. The Program (Software Server)

When we talk about a server in programming, we’re usually referring to software that listens for and responds to requests. This server-side code runs on a physical (or cloud) machine and handles everything from delivering web pages to managing databases.

The software server is the brain behind what the user sees. It can be written in many programming languages, each with its own strengths and tradeoffs.

Popular Server-Side Programming Languages

Server analogy image

Just the other day, while deploying my Node.js server to AWS, there was a knock at the door. A process server stood there delivering legal documents. As he handed me the papers, he said, “A server can be both hardware and software and both matter.”

The Takeaway