What is B/S architecture?

Table of contents

1. What is B/S architecture?

2. What is the difference between B/S architecture and C/S architecture?

3. Advantages and disadvantages of B/S architecture

Four. Several forms of B/S architecture

1: Client-Server-Database

2: Client - web server - application server - database

3: Client - load balancer (Nginx) - intermediate server (Node) - application server - database


1. What is B/S architecture?

B/S architecture, that is, browser/server architecture, is a network architecture model that concentrates the core part of system function realization on the server, which simplifies the development, maintenance and use of the system. The client only needs to install a browser to exchange data with the database server through the Web server. The B/S architecture utilizes Web browser technology and Internet protocols to realize the connection of heterogeneous systems and the sharing of information.

Layering of B/S architecture:

The first layer of presentation layer: mainly completes the interaction between the user and the background and the output function of the final query result.

The second logic layer: mainly uses the server to complete the application logic function of the client.

The third data layer: It mainly performs various calculations independently after accepting client requests.

2. What is the difference between B/S architecture and C/S architecture?

What is the difference between the B/S architecture and the traditional C/S architecture? C/S architecture, that is, client/server architecture, is a distributed application mode that divides system functions into two layers: client and server. The client is responsible for the user interface and business logic, and the server is responsible for data storage and processing. The C/S architecture needs to install dedicated software on each client, which has high requirements on network and hardware resources.

3. Advantages and disadvantages of B/S architecture

The B/S architecture and the C/S architecture have their own advantages and disadvantages, and the specific choice should be determined according to the requirements and environment of the system. Let’s compare their main features below:

- Development cost: The development cost of B/S architecture is relatively low, because existing Web technologies and tools can be used, and there is no need to consider client compatibility issues. The development cost of the C/S architecture is relatively high, because it needs to develop special client software and adapt to different operating systems and hardware environments.
- Maintenance cost: The maintenance cost of the B/S architecture is relatively low, because only the software on the server side needs to be upgraded, and the client side does not need to be installed or updated. The maintenance cost of the C/S architecture is relatively high, because it needs to be installed or updated on each client, and various software and hardware failures have to be dealt with.
- Security: The security of the B/S architecture is relatively low, because the data is easily intercepted or tampered with during transmission, and the client cannot control the user's access rights. The security of the C/S architecture is relatively high, because encryption or authentication technology can be used in the data transmission process, and the client can set the user's access rights.
- Interactivity: The interactivity of B/S architecture is relatively high, because various scripting languages ​​and ActiveX technology of Web browser can be used to realize dynamic and rich user interface. The interactivity of the C/S architecture is relatively low, because the functions and interfaces of the client software are limited by the development tools and platforms.
- Scalability: The scalability of the B/S architecture is relatively high, because the concurrency and reliability of the system can be improved by adding servers or load balancing technologies. The scalability of the C/S architecture is relatively low, because the compatibility and upgrade of the client software need to be considered.

To sum up, the B/S architecture is a network application mode suitable for the Internet environment. It has the advantages of simple development and maintenance, strong interactivity, and good scalability. But it also has disadvantages such as poor security and low data transmission efficiency. Therefore, when choosing a B/S architecture, it is necessary to

Four. Several forms of B/S architecture

1 : client-server-database

This should be a pattern we usually use more often:

1. The client initiates an Http request to the server

2. The web service layer in the server can handle Http requests

3. The application layer part of the server calls the business logic and calls the method on the business logic

4. If necessary, the server will exchange data with the database. Then render the template + data into the final Html and send it back to the client

2: Client - web server - application server - database

Similar to the first method, just decouple web services and application services

1 The client initiates an Http request to the web server

2 The web service can handle Http requests and call the RESTFUL interface exposed by the application server

3 The RESTFUL interface of the application server is called, and the corresponding exposure method will be executed. If it is necessary to interact with the database, the application server will interact with the database and return the json data to the web server

4 The web server renders the template + data combination into html and returns it to the client

3 : Client - load balancer (Nginx) - intermediate server (Node) - application server - database

This mode is generally used in applications with a large number of users and high concurrency.

1. What is exposed is not the address of the real web server, but the address of the load balancer

2. The client initiates an Http request to the load balancer

3. The load balancer can evenly forward the client's Http request to the Node server cluster

4. After the Node server receives the Http request, it can parse it and call the RESTFUL interface exposed by the application server

5. When the RESTFUL interface of the application server is called, the corresponding exposure method will be executed. If it is necessary to interact with the database, the application server will interact with the database and return the json data to Node

6. The Node layer renders the template + data combination into HTML and returns it to the reverse proxy server

7. The reverse proxy server returns the corresponding html to the client

 

Guess you like

Origin blog.csdn.net/qq_37310110/article/details/130198123