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

It's the end of the year, is your MySQL password safe?

Preface: It’s the end of the year, isn’t it time ...

MySQL 5.7 generated column usage example analysis

This article uses examples to illustrate the usag...

Detailed explanation of Bind mounts for Docker data storage

Before reading this article, I hope you have a pr...

Mysql NULL caused the pit

Using NULL in comparison operators mysql> sele...

HTML table markup tutorial (43): VALIGN attribute of the table header

In the vertical direction, you can set the alignm...

Docker data storage tmpfs mounts detailed explanation

Before reading this article, I hope you have a ba...

How to use ElementUI pagination component Pagination in Vue

The use of ElementUI paging component Pagination ...

How to View All Running Processes in Linux

You can use the ps command. It can display releva...

A comprehensive understanding of Vue.js functional components

Table of contents Preface React Functional Compon...

IDEA2020.1.2 Detailed tutorial on creating a web project and configuring Tomcat

This article is an integrated article on how to c...

Analysis of the difference between emits and attrs in Vue3

Table of contents in conclusion Practice Analysis...

Discussion on the problem of iframe node initialization

Today I suddenly thought of reviewing the producti...

Element sample code to implement dynamic table

Table of contents 【Code background】 【Code Impleme...