Skip to main content

Application Server

Updated 3 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/application-server

In short

An application server is software that runs an application's code and business logic, turning requests into dynamic responses, usually behind a web server.

What is an application server?

An application server is the program, or the machine running it, that hosts an application's code and runs its business logic: checking input, talking to databases and building the response for each request. Besides running the code, it usually provides shared services the code relies on, such as managing threads or worker processes, pooling database connections, handling sessions and transactions, and applying security rules.

The term comes from enterprise Java, where full application servers such as WildFly (formerly JBoss), Open Liberty, Oracle WebLogic and GlassFish implement the Java EE platform, now called Jakarta EE, and run applications deployed to them as WAR or EAR files. Lighter servers such as Apache Tomcat and Jetty implement only the web part, servlets, and are often called servlet containers. Other ecosystems have their own: Gunicorn and Uvicorn run Python apps, Puma runs Ruby on Rails, PHP-FPM runs PHP, and Kestrel runs ASP.NET Core.

In a typical setup, a web server or reverse proxy such as NGINX faces the internet, handles HTTPS and serves static files, and forwards dynamic requests to the application server, which in turn talks to the database. If the web server is a restaurant's front counter, the application server is the kitchen where each order is actually cooked. Many modern frameworks embed the server in the application itself: a Spring Boot app ships with Tomcat inside a single JAR file, and a Node.js app opens its own HTTP server.

Application servers are often confused with web servers, and the line between them is blurry. A web server specializes in HTTP connections, files, TLS and routing, while an application server specializes in running code; yet Tomcat can serve files too, and NGINX can run small scripts through modules. The distinction is about the main job each one does in the stack, not a strict technical boundary.

Key takeaways

  • An application server runs an application's code and builds dynamic responses.
  • It provides shared services such as worker management, connection pools, sessions and transactions.
  • Java application servers implement Jakarta EE, formerly Java EE; Tomcat is a lighter servlet container.
  • Python, Ruby, PHP and .NET have their own, such as Gunicorn, Puma, PHP-FPM and Kestrel.
  • A web server usually sits in front, handling HTTPS and static files.

Example

A Python app run by an application server behind NGINXpython
# app.py: the application code, as a minimal WSGI app
def app(environ, start_response):
    name = environ.get("QUERY_STRING") or "world"   # e.g. /?Ada
    start_response("200 OK", [("Content-Type", "text/plain")])
    return [f"Hello, {name}!".encode()]

# Gunicorn, a Python application server, runs it with 4 worker processes:
#   gunicorn --workers 4 --bind 127.0.0.1:8000 app:app
#
# NGINX, the web server, handles HTTPS on port 443 and forwards to it:
#   location / { proxy_pass http://127.0.0.1:8000; }

Readers ask

What is the difference between a web server and an application server?

A web server handles HTTP connections, HTTPS and static files, while an application server runs the code that builds dynamic responses. In most deployments, the web server sits in front and forwards dynamic requests to the application server.

Is Tomcat an application server?

Loosely, yes, and many people call it one. Strictly, Tomcat is a servlet container that implements only the web parts of Jakarta EE, while full application servers such as WildFly or GlassFish also implement the rest of the platform, such as transactions and messaging.

Do I still need an application server?

Every web application needs something that runs its code, but today it is often built in rather than installed separately. Spring Boot, ASP.NET Core and Node.js apps include their own server, and containers have largely replaced deploying many apps to one shared Java application server.

See also

Sources

Spotted a mistake or something missing on this page?Suggest an edit

More

Settings