Skip to Content
Beyond the Twelve-Factor App
book

Beyond the Twelve-Factor App

by Kevin Hoffman
April 2016
Intermediate to advanced content levelIntermediate to advanced
70 pages
1h 11m
English
O'Reilly Media, Inc.
Content preview from Beyond the Twelve-Factor App

Chapter 11. Port Binding

Factor 7 states that cloud-native applications export services via port binding.

Avoiding Container-Determined Ports

Web applications, especially those already running within an enterprise, are often executed within some kind of server container. The Java world is full of containers like Tomcat, JBoss, Liberty, and WebSphere. Other web applications might run inside other containers, like Microsoft Internet Information Server (IIS).

In a noncloud environment, web applications are deployed to these containers, and the container is then responsible for assigning ports for applications when they start up.

One extremely common pattern in an enterprise that manages its own web servers is to host a number of applications in the same container, separating applications by port number (or URL hierarchy) and then using DNS to provide a user-friendly facade around that server. For example, you might have a (virtual or physical) host called appserver, and a number of apps that have been assigned ports 8080 through 8090. Rather than making users remember port numbers, DNS is used to associate a host name like app1 with appserver:8080, app2 with appserver:8081, and so on.

Avoiding Micromanaging Port Assignments

Embracing platform-as-a-service here allows developers and devops alike to not have to perform this kind of micromanagement anymore. Your cloud provider should be managing the port assignment for you because it is likely also managing routing, scaling, high ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beyond Vibe Coding

Beyond Vibe Coding

Addy Osmani
AI Agents in Action

AI Agents in Action

Micheal Lanham
Developing Apps with GPT-4 and ChatGPT

Developing Apps with GPT-4 and ChatGPT

Olivier Caelen, Marie-Alice Blete

Publisher Resources

ISBN: 9781492042631