Tomcat components illustrate the architectural evolution of a web server

Tomcat components illustrate the architectural evolution of a web server

1. Who is tomcat?

2. What can tomcat do?

Tomcat is a web container. Web applications can be deployed to Tomcat, which provides web services. Multiple web applications can be deployed in one web container. These web applications can be services of the same domain name or multiple domain names.

3. What are the components of tomcat

4. How to quickly understand these components?

We can assume that we are designing a web container, what should we design?

The first generation: receiving requests, processing requests, and returning results to the entire web container, as shown in the following figure:

Second generation: Separate connection management and processing logic

During use, I found that it was annoying to open the socket connection, call the processing logic, and then close the socket connection every time. I simply let the Connector handle the closing of the socket connection, and let the Container handle the business logic of the request. That's it.

Third generation: Support multiple network protocols

The original goal was to design a web server or container. If you want to support more protocols, you need to create different Connectors and Containers. At this time, it becomes like this, where service wraps Connectors and Containers.

Fourth generation: support for multiple web applications

Since it is a container, it must support multiple applications. Each application has a Context and is isolated from each other. The architecture that supports multiple Contexts is as follows:

Fifth generation: support for multiple domain names

Contexts require not only physical isolation, but also logical isolation, such as app1.example.com accessing context1 and app1.test.com accessing context2.

The architecture at this point should be like this: the host can support multiple contexts.

5. Summary:

  • The components of the web server are server-->satisfy the function
  • server+connector+Container-->Separation of responsibilities
  • server+service+connector+Container-->Support multiple protocols
  • server+service+connector+Container+context-->support multiple applications
  • server+service+connector+Container+host+context -->Support multiple applications with multiple domain names

In fact, it is a process of division of labor and refinement of components, similar to the refinement of social division of labor. Note that Container is also called engine in Tomcat.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Looking at Tomcat's thread model from the connector component - BIO mode (recommended)
  • Detailed explanation of Tomcat core components and application architecture

<<:  A simple explanation of MySQL parallel replication

>>:  How to deeply understand React's ref attribute

Recommend

The difference and use of json.stringify() and json.parse()

1. Differences between JSON.stringify() and JSON....

Summary of four situations of joint query between two tables in Mysql

Generally speaking, in order to get more complete...

React implements double slider cross sliding

This article shares the specific code for React t...

Complete Tutorial on Deploying Java Web Project on Linux Server

Most of this article refers to other tutorials on...

How to test the maximum number of TCP connections in Linux

Preface There is a misunderstanding about the max...

Implementation of react loop data (list)

First, let's simulate the data coming from th...

Understanding what Node.js is is so easy

Table of contents Official introduction to Node.j...

docker logs - view the implementation of docker container logs

You can view the container logs through the docke...

Detailed explanation of the use of stat function and stat command in Linux

stat function and stat command Explanation of [in...

A complete list of commonly used HTML tags and their characteristics

First of all, you need to know some characteristi...