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

Nodejs module system source code analysis

Table of contents Overview CommonJS Specification...

...

Navicat imports csv data into mysql

This article shares with you how to use Navicat t...

Completely uninstall mysql. Personal test!

Cleanly uninstall MySQL. Personally tested, this ...

Tutorial diagram of using Jenkins for automated deployment under Windows

Today we will talk about how to use Jenkins+power...

A brief discussion on the fun of :focus-within in CSS

I believe some people have seen this picture of c...

Teach you how to monitor Tomcat's JVM memory through JConsoler

Table of contents 1. How to monitor Tomcat 2. Jav...

This article helps you understand PReact10.5.13 source code

Table of contents render.js part create-context.j...

JS native 2048 game source code sharing (the latest on the Internet)

I have been learning about algorithms recently an...

Process analysis of deploying ASP.NET Core applications on Linux system Docker

Table of contents 1. System environment 2. Operat...

Should I use UTF-8 or GB2312 encoding when building a website?

Often when we open foreign websites, garbled char...

How to design a web page? How to create a web page?

When it comes to understanding web design, many p...

A brief discussion on using Vue to complete the mobile apk project

Table of contents Basic Configuration Entry file ...

Mysql dynamically updates the database script example explanation

The specific upgrade script is as follows: Dynami...