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

06 Sep 2024

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

Get The Vibe Right


As a web developer, you often come across the word server, and it can mean different things depending on the context. This can sometimes be 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 to her, '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.
Who's Serving Who? The Code vs. The Machine

1. The Physical Machine (Hardware/Cloud Server)


A server is a physical machine that provides resources to other computers. It could be housed in a data center or a virtual server provisioned in the cloud. Either way, the server runs 24/7 (or should be) to serve up files, often times 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 often rely on software like Apache or Nginx, which handle incoming requests and send the appropriate files or data to users.

The physical difference between traditional on-prem servers and cloud servers lies in virtualization:
  •     On-Premise Servers: Dedicated hardware maintained by a company or data center.
  •     Cloud Servers: Virtual machines running on shared infrastructure, providing scalability without needing to manage the physical hardware.

Key Characteristics:
  •     It’s hardware with CPU, memory, and storage.
  •     Both on-premise and cloud servers provide computing power for applications.
  •     Cloud servers offer elastic scaling, but under the hood, they’re still physical machines.

It’s funny—I went out for drinks after a volleyball game, and a teammate and I started discussing his confusion about what Node.js is. Man, he’s a strong server… I explained to him that, in programming, a server can refer to software that listens for requests and responds to them. This server-side code runs on a physical (or cloud) server and handles everything from delivering web pages to managing databases. A server within a server, so to speak. Server-Seption!

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

2. The Program (Software Server)


When we talk about a server in the context of programming, we’re usually referring to a piece of software that listens for and responds to requests. This server-side code runs on the physical machine (or cloud server) and does everything from delivering web pages to managing databases.
The software server is essentially the brain behind what the user sees. It can be written in many different programming languages, each with its own strengths and use cases.

Popular Server-Side Programming Languages:

  • JavaScript (Node.js): JavaScript can now be used on the server thanks to Node.js, which allows you to write server-side logic in the same language used for front-end development. It's particularly well-suited for handling asynchronous operations, such as processing multiple requests simultaneously.
    Common Frameworks: Express.js, Nest.js
  • Python: Python is popular for its simplicity and readability, making it great for building servers that need to scale quickly. Python's flexibility makes it ideal for everything from small APIs to large-scale web applications.
    Common Frameworks: Django, Flask
  • Ruby: Ruby, especially with its Rails framework, is often praised for its simplicity and ability to create fully-featured web applications quickly. Ruby is great for developers who prioritize developer happiness and ease of use.
    Common Frameworks: Ruby on Rails, Sinatra
  • Java: Java is widely used in enterprise environments for building large, robust applications. It’s known for being highly scalable and stable, which is why it's often found in banking and large corporate systems.
    Common Frameworks: Spring Boot, Java EE
  • PHP: PHP has been around for a long time and is still a dominant force in the web, especially with content management systems like WordPress. PHP is great for server-side scripting and is widely supported in hosting environments.
    Common Frameworks: Laravel, Symfony
  • C# (ASP.NET): Microsoft’s C# language is popular for building enterprise applications, particularly within the .NET framework. It’s a powerful language that can handle complex business logic while integrating smoothly with Windows-based environments.
    Common Frameworks: ASP.NET Core
Who's Serving Who? The Code vs. The Machine
It’s funny—just the other day, I was working on deploying my Node.js server to the cloud server I set up on AWS when there was a knock at the door. Lo and behold, a process server was there, delivering some legal documents. As he handed me the papers, he said, 'You know, a server can be both hardware and software, but they both play important roles in the ecosystem.'

I was taken aback by the coincidence. But he was right—whether it's a physical server in a data center, or the code running on that machine, each one plays a crucial role.

The takeaway is this:

  • Physical servers (like my restaurant server) handle the hardware side, making sure data gets from point A to point B.
  • Software servers (like my volleyball buddy) handle the programming side, receiving requests (serving the ball), processing them (setting it up), and sending responses (spiking the ball).
  • And sometimes, other ‘servers’ are there to remind you that not all servers live in the digital world! A good server knows how to handle requests… unlike some servers I know… JK... but seriously.