Why have an application server
In the past ten years, Internet-based applications are developing at an unprecedented high speed, and one of the important directions is the development of Web-based application systems. During this period, with the continuous renewal of technology and the continuous deepening of applications, the development of Web application systems has also experienced several phased leaps.
In the early days of the development of the Web, people usually use a
Web server as an information publishing tool. It receives HTTP requests from users and then provides corresponding HTML documents according to the requests. In addition to the features of richer display methods, HTML documents and ordinary static texts There is no essential difference. Subsequently, the need for dynamic pages and more interactive capabilities arises. New applications need to dynamically obtain data from the database and display it according to customer requests. The resulting technical means include CGI and Web server built-in API. These methods meet the application requirements to a certain extent, but they all have their own limitations: CGI is low in efficiency and slow, while the built-in API is difficult to develop and poor in portability.
With the expansion of the scope of Web applications, the Web based on commercial applications has begun to appear, and people need more complex and flexible application development support from the Web server. The application of technologies such as JavaScript and VBScript, and the application of objects and components in the Web enable the rapid development of Web-based commercial program development. But this kind of application is usually only suitable for building small-scale commercial systems. When the commercial system is further expanded, its scalability is limited, because the original design purpose of the Web server does not include large-scale, high-performance and high Reliable support for commercial applications.
The
application server was created to break through this bottleneck. The application server is completely different from the Web server. It is a brand-new operating environment specially designed for Web applications based on high-end processing with high load. High reliability, robust program logic processing capabilities, can easily provide services for thousands or even millions of users.
On the other hand, the emergence of application server is closely related to the evolution and development of software architecture. Let us briefly review the history of the development of software architecture. Compatible with the original large central host, the original software structure is also the Mainframe structure. Under this structure, clients, data, and programs are concentrated on the host, usually only a few GUI interfaces, and access to remote databases is difficult. With the widespread use of PCs, this structure is gradually eliminated in applications.
In the mid-1980s, the Client/Server distributed computing structure appeared, and the processing of the application was shared between the client (PC) and the server (Mainframe or Server); the request was usually processed by the relational database, and the PC was processed when it was received. Realize display and business logic after the data; the system supports modular development, usually with GUI interface. Client/Server structure has been extremely widely used because of its flexibility. But for large-scale software systems, this structure still has shortcomings in terms of system deployment and scalability.
The development of the Internet has brought a profound impact on the development of traditional application software. Software and application systems based on the Internet and Web undoubtedly need a more open and flexible architecture. As more and more commercial systems are moved to the Internet, a new and more vital architecture is widely adopted, which is what we know as "three-tier/multi-tier computing."
A typical three-layer model is shown in the figure below:
. Client tier The user interface and the place where user requests are issued. Typical applications are web browsers and fat clients (such as Java programs)
. Server tier (server tier) Typical applications are web servers and application servers running business codes
. Data tier Typical applications are relational databases and other back-end data resources, such as
Oracle and SAP, R/3, etc.
In the three-tier architecture, customers (requesting information), programs (processing requests), and data (operated) are physically separated. The three-tier structure is a more flexible architecture, which separates the display logic from the business logic, which means that the business code is independent, and you don't care how and where to display. The business logic layer is now in the middle layer, and there is no need to care about which types of customers display data, and it can also maintain relative independence from the back-end system, which is conducive to system expansion. The three-tier structure has better portability, can work across different types of platforms, and allows users to request load balancing among multiple
servers. Security in the three-tier structure is also easier to implement, because the application has been isolated from the customer.
What is an application server
The application server is a part of the three-tier/multi-tier architecture, and the application server is located in the middle tier. As shown in the figure above, the
application server runs between the browser and the data resource. A simple example is that a customer enters an order from the browser, and the web server sends the request to the application server, and the application server performs processing Logic, and get or update back-end user data.
In enterprise-level applications, the application server is the middleware between enterprise data (and other enterprise legacy systems) and customers who access enterprise data. It provides an environment for storing and running business codes. It physically separates the business logic from the client and data resources. The application server allows a business system to be developed and deployed quickly and easily, and it can also adapt to the increase of users of the business system without restructuring the system, all because it is in a relatively independent structural layer. In practical applications, an enterprise system can consist of multiple application servers, multiple Web servers, and multiple database servers, and application code can be distributed on these multiple application servers.
Application server is the only way for enterprise-level web applications. New enterprise-level applications require critical applications to be continuously available to the ever-increasing number of users. In addition, enterprise applications also require high security and reliability, regardless of the access system Whether the number of users of the system changes or the system data resources change, the application server should always keep running. Before the application server, web applications usually run in the web server, but the web server was originally designed to provide web page-related services, so developing/running web applications is slow and complicated. The powerful functions of the application server can provide a strong guarantee for the development and deployment of enterprise-level application systems.
A definition of application server is as follows: software server products that adopt an integrated structure with distributed computing capabilities and support thin clients. The basic purpose of an application server includes: managing client sessions, managing business logic, and managing connections with back-end computing resources (including data, transactions, and content).
The scope of the above definition is the application server itself. We believe that in fact, the application server should also include its development environment. Each application server product has its own API. In order to make full use of the functions provided by the application server, developers must learn to program with these APIs. The server's API is very important to the development of practical systems. It takes a certain amount of learning time to master the API methods and the functions they provide.
Increasingly, application servers adopt standardized technologies such as COM, CORBA, Enterprise JavaBeans (EJB), and Java Servlets (where CORBA and EJB are more commonly used). The adoption of the above standardized technologies makes development easier because they Provides a standardized API for general server management functions, and follows the standard to ensure that the original components are portable when the application server is changed.
But on the other hand, each application server product provider will expand the standard and add its own characteristics to gain a competitive advantage. This has led to a lot of controversy in the Web world, and the compatibility of standards has become a hot issue.
A very important question lies in front of web application system developers: Do I need an application server?
The answer is usually yes, especially when you want to build an enterprise-level system. Even if you don't have scalability requirements, you can get many other benefits from the application server. Web-based development has rapidly shifted from data publishing and low-maintenance applications to complete and complex commercial applications. Application server can simplify the development of new commercial interactive programs; as the scale of application systems continues to expand, logic reuse and team development become more and more important. In addition, because applications need to obtain more data resources in the organization, centralized management and centralized security of data access are becoming more and more important. The application server provides a good solution for this through object and component technology.
If you need to build an application system that supports both HTML clients and fat clients, you definitely need an application server. As a three-tier client/server structure, you certainly can’t miss the middle layer! You can also use the business logic and data access components of the application server.
The application server must obtain the components it needs from somewhere (business logic, data access objects, HTML generation components, etc.), and these components must be loaded into the server. The ease of component development and loading depends on the development environment. Some application server providers rely on third-party IDEs and tools to provide components for the server, while others integrate development tools with the server. You can make a choice according to your specific needs.