当前位置:网站首页>On the working principle, advantages and disadvantages of C / s and B / S architecture

On the working principle, advantages and disadvantages of C / s and B / S architecture

2020-11-10 18:04:43 Linux background development

 Talking about C/S and B/S The working principle, advantages and disadvantages of the architecture

C/S framework

One 、C/S Architecture and its background

C/S Architecture is a relatively early software architecture , Mainly used in LAN . Before that, I experienced the centralized computing mode , With the progress and development of computer network , Especially the application of visualization tools , There have been two layers C/S And the third floor C/S framework , But it has always been very popular and classic is what we want to study Two layers of C/S framework .

 Talking about C/S and B/S The working principle, advantages and disadvantages of the architecture

C/S Architecture software ( That is, the client / Server mode ) It is divided into There are two layers of client and server : The first layer is a combination of presentation and business logic on the client system , The second layer combines database server through network . In short, the first layer is the user presentation layer , The second layer is the database layer .

The client is directly connected to the server , Both of these components play an important role , The first tier client is not just input and output , The ability to calculate , It can handle some calculations , Data storage and other aspects of business logic transactions ; The second layer server is mainly responsible for the processing of transaction logic , It was a heavy business , But because the client can share some logical transactions , So it lightens the load on the server , Make network traffic increase .

Want to use C/S Architecture software needs to download a client , After installation, you can use .

need C/C++ Linux Server architect learning materials plus group 812855908( The information includes C/C++,Linux,golang technology ,Nginx,ZeroMQ,MySQL,Redis,fastdfs,MongoDB,ZK, Streaming media ,CDN,P2P,K8S,Docker,TCP/IP, coroutines ,DPDK,ffmpeg etc. ), Free to share

 Talking about C/S and B/S The working principle, advantages and disadvantages of the architecture

Two 、C/S Advantages of Architecture

C/S Since architecture has been able to flourish in the long history of computer, it must have its own flash . The following will be analyzed from various angles C/S Advantages of Architecture .

1) The client is directly connected to the server

a) Point to point mode makes it safer .

b) You can directly manipulate the local text , Reduce the time and effort of getting text .

c) Because of the direct connection , Reduced traffic , This can save a lot of money for customers .

d) Direct connection , There is no barrier or fork in the middle , So the response is fast . It doesn't feel like much when there's less traffic , But if the traffic is huge , There will be no congestion .

2) The client can handle some logical transactions

a) Make full use of both hardware facilities , Avoid wasting resources .

b) Share some logical transactions for the server , It can process data and store data . Can handle complex transaction processes .

c) The client has a complete set of applications , In the error prompt 、 Online help and other aspects have powerful functions , And can freely switch between subroutines .

3) Client operation interface

a) Can improve the visual experience of customers , Meet customer needs .

b) The client interface can be arranged at will , Fully meet the needs of customers , Show character and personality .

3、 ... and 、C/S Disadvantages of Architecture

After a long test of time , People have also found C/S The inadequacies of being , The following is a summary of the previous views .
1) client

a) It can only handle multiple systems with single function .

b)C/S Architecture for LAN , The demand for network speed is relatively high .

c) Due to the need to install the client , Difficult to install and deploy , So it's not easy to expand .

d) If the client uses a different system , We have to program these systems separately .

e) The client interface lacks generality , And when the business changes, you need to change the interface , Rewrite .

f) The client needs a special client program , More trouble , For the user group with many points and wide range and without network conditions , Can not achieve rapid deployment installation and configuration .

2) The server

a) If the number of users increases, there will be communication congestion , Slow response of the server .

b) When the server is in trouble , It can only be discarded , Use a more powerful server .

c) As the number of client users increases , The server can't bear the burden , Is worthy of the name “ fat ” client .

d) The user is through ODBC Connected to the database , And every user connected to the database will keep one ODBC Connect , Will always occupy the resources of the central server , It's very demanding on the server .

3) user

a) External users without a client installed cannot access .

b) Only the client can access the server , So users can't access it anytime, anywhere .

c) The user is through ODBC Connected to the database , So the number of users is limited , It's not easy to expand .

d) Because it's for a small range of customers , So we can't share the information in a wide range , Delivering and delivering information .

a) We need to hire high-quality people , Train them , The cost is high .

b) The initial development needs to be equipped with a good client , The server , Need to have a professional level of technical personnel , So the cost is high .

a) System upgrade maintenance is troublesome , A lot of programs need to be changed , Invest a lot of energy and money .

b) When the business expands or changes , Need to change the program , The client interface also needs to be changed .

c) You can't do it once and for all , It takes a lot of cost later , For example, the replacement of the server , Client changes, etc .

Four 、C/S Architecture Application

C/S The software of architecture is countless , From office OFFICE,WPS,WINRAR To antivirus software such as Jinshan , Ruijin to our entertainment software , Like a player ,QQ, WeChat, etc. , Everywhere C/S framework .

B/S framework

One 、B/S Architecture and its background

With Internet and WWW The popularity of , The old mainframe / Terminals and C/S Can not meet the current global network opening 、 interconnection 、 Information everywhere and new requirements for information sharing , So it came out B/S Model , Browser / Server structure . It is C/S An improvement in architecture , It belongs to three levels C/S framework . It's mainly using the maturing WWW Browser technology , With a general browser to achieve the original need for complex special software to achieve a powerful function , And save the development cost , Is a new software system construction technology .

 Talking about C/S and B/S The working principle, advantages and disadvantages of the architecture

The first layer is browser , The client side , Only simple input and output function , Deal with a very small part of the transaction logic . Because customers don't need to install clients , As long as you have a browser, you can browse the Internet , So it's aimed at a wide range of users , So the interface design is relatively simple , Universal .

The second level is WEB The server , Playing the role of information transmission . When the user wants to access the database , I'll go first to WEB The server sends the request ,WEB After the server unifies the request, it will send the request of accessing the database to the database server , This request is based on SQL Statement implementation .

The third layer is database server , He plays an important role , Because it holds a lot of data . When the database server receives WEB After the server's request , Would be right SQL Statement processing , And send the returned results to WEB The server , Next ,WEB The server converts the received data result to HTML Text to browser , That's the interface we see when we open the browser .

B/S The architecture and C/S Different architectures , The browser is not directly connected to the database server , So it's a many to many structure . So under this structure , It's very suitable for implementing a huge Internet in Wan , Even the global network . It has very strong information sharing .

stay B/S In the early days , Browsers can only display static pages , No good interaction , Can't do a lot of logical processing , At that time, browsers were mainly used to publish information , It's a one-way application . Then came the dynamic web page , There are three aspects of the dynamics here , One is interaction , The second is animation , The third is data . such , Browser interactivity can be greatly improved . The pages are becoming more and more colorful . Browsers can also handle some logical transactions , So the browser becomes the client , But because there is less to deal with , So called “ Thin ” client .

Two 、B/S Advantages of Architecture

B/S Architecture should be WEB The rapid development of technology from the traditional C/S Architecture evolved , And become the main network architecture today . The main websites at present , In particular, business websites are based on B/S Architecture built . So let's count it in detail B/S Advantages of Architecture , Why is it so popular .
1) browser

a) Can face the vast number of users to achieve information dissemination and sharing .

b) The browser only deals with simple logical transactions , Small burden .

c) Page updates can be synchronized , All users can see .

d) Interface design and development is simple , Less demanding on programmers , It doesn't take a lot of training .

e) Business expansion is convenient , Just add a few pages for business expansion , It doesn't take a lot of programming .

f) The interface doesn't need too much writing , More general , It's easy to change the interface , So there's almost no maintenance .

g) because Web Platform independence , It can be from a server 、 Working group level expansion of several users into a large system with tens of thousands of users .

a) The data is stored in the database server , So there is no data inconsistency .

b) Effectively protect data platform and manage access rights , The server database is also secure .

c) You don't have to use WINDOWS System , Choose more , It costs less .

d) If it's a different place , Just connect the server to the private network , Remote maintenance 、 Upgrade and share .

e) stay JAVA After the emergence of such a cross platform language ,B/S Architecture management software is more convenient 、 quick 、 Efficient .

f) The data is stored in the database server , The client does not store any business data or database connection information , So the data is more secure .

g) As the server load increases , It can smoothly increase the number of servers and establish a clustered server system , Then load balancing among servers .

a)B/S Built on the wan , The required network speed is not high .

b) External users can also access the browser .

c) User friendly interface , Generalization , It doesn't take much training to master .

d) No client installation required , As long as you can connect to the Internet , Can browse the page anytime, anywhere .

e) With the help of Internet The powerful ability of information release and information transmission can effectively solve the irregular information exchange within the enterprise .

f) All users are through a JDBC Connection buffer pool connected to the database , The user does not maintain a connection to the database , The number of users is basically unlimited .

4) cost

a) Strong software reuse , It saves a lot of cost .

b) No need to install special software , The client is almost zero maintenance .

c) Development of simple , Easy to upgrade , People don't need much training , It saves a lot of money .

d) Clients require little maintenance , Just keep an eye on the server , So it costs less .

e) Generally, only the initial one-time input cost , It is good for software project control and avoidance IT Black holes .

f) Built on a wide area network , It doesn't have to be a dedicated network hardware environment , For example, the Internet over the phone , Hire equipment, etc , Less cost .

3、 ... and 、B/S Disadvantages of Architecture

although B/S Architecture has many advantages , But there are also inevitable flaws , Otherwise, there will be no war of words about which architecture to use . however , In theory , since B/S yes C/S Improved version , It should be overcome C/S A lot of defects of , So the disadvantages should not be many . Let's take a look at what's actually going on .
1) client

a) Face generalization , No personality .

b) The page needs to be refreshed dynamically , In particular, the number of users has increased , Slow network speed , It's time-consuming .

c) Because there is no need to install the client , The client is easy to expand , What's more, external users can also access , therefore B/S Facing a large number of unknown users .

2) The server

a) As the number of users increases , The server is slow to respond .

b) Although the functions are diversified , But it can't be specialized , Can't implement complex functions .

c) Servers take on important responsibilities , Heavy data load . Once the server happens “ collapse ” Other questions , The consequences are unimaginable .

Four 、B/S Architecture Application

I was explaining the typical C/S Architecture , Mentioned the commonly used QQ Software . Now there's a new one WEBQQ, from WEBQQ In name WEB It's not hard to see that it belongs to B/S framework , It's a browser server structure . In fact, it's the same , because WEBQQ There's no need to install the client at all , Just have a browser to chat and interact .

C/S and B/S

One 、C/S and B/S Overview of the relationship

B/S Architecture from C/S Architecture improvements , It can be said that there are three layers C/S framework , This shows that the relationship between the two is not general .B/S from C/S Out of it , Later, along with WEB The rapid development of technology and people's increasing dependence on the network ,B/S It has become the most popular network architecture today . Both structures are powerful in their respective positions , They have their own advantages , Are very important network architectures . In response speed , The user interface , Data security and so on ,C/S be better than B/S, But in business expansion and Application www Under the condition of ,B/S Obviously better than C/S. You can say that ,B/S Its strength is C/S Weaknesses , vice versa . They have their own advantages and disadvantages , There is no substitute for each other .

Two 、C/S and B/S The difference between

 Talking about C/S and B/S The working principle, advantages and disadvantages of the architecture

1) The big difference
1、 structure

C/S It's a two-tier architecture , It consists of client and server , and B/S It's a three-tier architecture , By the browser ,WEB Server and database server consist of .

2、 Logical transaction processing
C/S The architecture reasonably allows the client and server to undertake part of the logical transaction processing , Make the burden of server lighten , And the client can also carry out some data processing and storage functions .B/S The browser of architecture is its client , But this client can only carry out some simple input and output and information sharing functions , The main logical transaction processing still depends on the server , So the load on the server is heavy .

3、 working principle
C/S The architecture is that the client and the server are connected directly , Realize point-to-point communication ,B/S It's the browser through WEB The server sends a data request to the database server , Realize many to many communication .

4、 Response speed
C/S The client and server of the architecture are connected directly , There's no barrier in between , So the corresponding speed is fast , Especially when the number of users increases .B/S The architecture is slow , The main responsibility lies in the database server , because B/S Unlimited scalability of Architecture , When users proliferate , When the traffic is huge , The server is slow , The server is in danger of paralysis .

5、 cost
C/S Architecture development , Hardware needs to be purchased at one time , The cost is high , And you need trained technicians , The cost of training is high , And software later also needs to invest a lot of money .B/S Architecture requires a one-time investment, and it can be done almost once and for all , Good for software project control and IT Black holes .

6、 maintain 、 Upgrade and expand
C/S Once the architecture changes or needs to be upgraded , The client interface needs to be redesigned , A lot of manpower and material resources are needed . Software maintenance is also troublesome , Need professional maintenance . User extension is also troublesome , The client needs to be installed , High requirements for software and hardware .B/S It is very easy to maintain and upgrade the architecture , Just change the content of the page or add or delete the page , The client is almost zero maintenance , Just maintain the server . So it's relatively easy , convenient . because B/S Can be accessed anytime, anywhere , So it's easy to expand .

7、 Information sharing
C/S The architecture is built on LAN , It's for the limited number of known users , Information sharing is only on a small scale .B/S The architecture is built on the wan , Users can access it anytime, anywhere , External users can also access , In especial WEB The continuous development of technology ,B/S We are facing an almost infinite user group , So information sharing is very strong .

8、 Client interface
C/S Architecture can design different user interfaces for different functions , Personalization . But once the business changes, it needs to be redesigned , so much trouble .B/S The user interface of the architecture is very general , Can't highlight personality for users , But when the business changes, you only need to change the interface content or add or delete pages , It's easy to do .

2) Little difference
1、 Applicable network
C/S The architecture is based on LAN , Local area networks provide services through special servers .B/S The architecture is based on WAN , There is a wider range of use .

2、 visit
C/S Under the architecture , Users need to install the client to access the server , and B/S Under the architecture , Users can access it anytime, anywhere , As long as there is a web and a browser , Convenient and quick .

3、 Database connection type

C/S It's using ODBC Connect , So as long as users connect to the database, they will keep the connection and will not be disconnected , So it limits the number of users , and B/S It's using JDBC Connect , The user does not maintain a connection to the database , So the number of users is almost unlimited .

4、 function
C/S Architecture can implement a single complex function , Such as financial management , So now most of the larger ones ERP The system is still C/S framework ,B/S The interface of the architecture is relatively common , Less logical transactions can be processed , So the function is weak .

5、 Security
C/S The architecture is built on LAN , For more fixed users , Higher requirements for safety .B/S The architecture is built on the wan , In the face of the unknown , Poor safety .

6、 Information flows in different directions
C/S Procedures are typically centralized and mechanical , Relatively low interactivity B/S Information The flow direction can change , B-B B-C B-G Etc 、 The change of flow direction , More like a trading center .

7、 Requirements for technicians
C/S The function is more professional , High requirements for designers and developers , Need professional training .B/S The interface is more user-friendly , Generalization , So it doesn't take much skill .

版权声明
本文为[Linux background development]所创,转载请带上原文链接,感谢