Web Server vs. Application Server: What’s the Difference?

For many developers, web application development is a whole new ball game. Common misperceptions about device-level web development can result in the selection of the wrong choice of development tools which causes frustration and delayed projects.

Web Server:

A web server fetches and relays a static HTML file.

Application Server:

An application server executes each page as a computer program each time the page is accessed by a web client.

Application Server vs. Web Server

For a quick, visual comparison of the two, check out our Web Server vs. Application Server TL;DR chart:

Web Server vs. Application Server

How Do Web Servers and Application Servers Work Together?

In a typical (non embedded) deployment, a website runs a web server for the static content and a separate application server for the business logic. However, in resource constrained systems, including embedded systems and devices, a combined web server and application server is necessary. These systems require a small application server with a fast internal embedded web server.

What is business logic?

The phrase business logic is a bit of a misnomer as one might think it is related to business software. Business logic simply means the server can generate dynamic content and/or execute custom code on the server in response to incoming requests. Application server clients are often applications themselves and can include other application servers. Communication between the application server and its clients can take the form of HTTP messages, but can be any protocol including industrial protocols such as Modbus and OPC-UA.

Web Server & Application Server Tutorials

What is the difference between web servers and application servers

Web based device management applications require the remote browser to be able to ‘talk’ to the system or device under control. A web server provides no such capability, so everything between the simple processing of HTTP and the application code itself becomes overhead to be developed as a part of the system. This is an unwelcome diversion from the cool application-specific code that makes the device do what it needs to do: control hydraulics on tanks, position satellite dishes, monitor incubator temperatures, or control production plant, lighting, heating, nightclub lasers, and so on. For more information, see the full tutorial: What is an Embedded Application Server?.

Hands-On Application Server Tutorial

When developing modern interactive HTML5 web applications, you do not necessarily have to run the application server on the same operating system or device as you are developing on. The following video illustrates how one can develop a modern HTML5 Vue.js application by keeping all HTML files on your local development computer and use services provided by an online application server for the backend stuff.

See the tutorial a modern approach to embedding a web server in a device for details on the hands-on tutorial.

Controlling Hardware With a Micro-Controller Using an Application Server:

Do you like to tinker with hardware? An application server can run on a micro-controller thus enabling fast and super easy development of device control logic by using an easy to use scripting language. The following video shows a servo being controlled in real time by sending JSON messages over WebSockets from the browser to the application server running on on a tiny micro-controller. You can find more information on this project at the Lua and Barracuda Application Server for ESP32 page.