Talking about C/S and B/S Architecture

Overview

In this rapidly expanding information society, we have to say that human beings are entering a new era, that is, the information age. A major and prominent feature of the information age is the application of computer networks. From the initial centralized computing, the computer network has gone through the Client/Server stage (with two layers of C/S and three layers of C/S), and has developed to the most popular Browser/Server computing model. Among them, the C/S and B/S architectures are quite controversial and influential . C/S is an architecture with a long history and very mature technology. B/S is a new generation architecture. It is derived from C/S and has many innovations. , in the age of web information.



C/S Architecture

1. C/S architecture and its background

The C/S architecture is an early software architecture and is mainly used in local area networks. Prior to this, the centralized computing model has been experienced. With the progress and development of computer networks, especially the application of visualization tools, there have been two-layer C/S and three-layer C/S architectures, but we have always been popular and classic. The two-tier C/S architecture to be studied .


The C/S architecture software (ie client/server mode) is divided into two layers : client and server : the first layer is the combination of presentation and business logic on the client system, and the second layer is combined with the database server through the network. Simply put, the first layer is the user presentation layer, and the second layer is the database layer.


The client and the server are directly connected, and both components play an important role. The client of the first layer does not only have the capabilities of input and output, computing, etc., it can handle some business logic transactions such as computing and data storage; The server of the second layer is mainly responsible for the processing of transaction logic. Originally, the transaction is very heavy, but because the client can share some logical transactions, the burden on the server is reduced, which increases the network traffic.


Software that wants to use the C/S architecture needs to download a client, which can be used after installation .


Second, the advantages of C/S architecture

Since the C/S architecture can flourish in the long river of computer history, it must have its shining points. The following will analyze the advantages of the C/S architecture from various angles.

1) The client and the server are directly connected

a) The peer-to-peer mode makes it more secure.

b) The local text can be directly manipulated, reducing the time and effort of acquiring the text.

c) Due to the direct connection, the communication traffic is reduced, which can save a lot of money for the customer.

d) Directly connected, there is no barrier or fork in the middle, so the response speed is fast. When the traffic volume is low, there is no feeling, but if the traffic volume is large, there will be no congestion.


2) The client can handle some logical transactions

a) Make full use of the hardware facilities of both to avoid waste of resources.

b) Share some logical transactions for the server, which can perform data processing and data storage. Can handle complex business processes.

c) The client has a complete set of application programs, which have powerful functions in error prompts, online help, etc., and can switch freely between subprograms.


3) Client operation interface

a) It can improve the customer's visual experience and meet customer needs.

b) The client operation interface can be arranged at will to fully meet the needs of customers and show the characteristics and individuality.

3. Disadvantages of C/S Architecture

After a long time test, people have also found the shortcomings of C/S. The following is a summary of the views of the predecessors.
1) Client

a) Can only handle some multi-systems with a single function.

b) The C/S architecture is suitable for local area networks, and the requirements for network speed are relatively high.

c) Due to the need to install the client, the installation and deployment are difficult, so it is not easy to expand.

d) If the systems used by the client are different, programs should be written separately for these systems.

e) The client interface lacks universality, and when the business changes, the interface needs to be changed and rewritten.

f) The client needs a special client program, which is troublesome. For the user group with a wide range of points and no network conditions, it cannot achieve rapid deployment, installation and configuration.


2) Server

a) When the number of users increases, there will be communication congestion and slow server response.

b) When the server is difficult to be a big task, it can only be discarded and a more powerful server can be used.

c) When the number of client users increases, the server can hardly bear the heavy load, and it is a veritable "fat" client.

d)用户是通过ODBC连接到数据库的,且每个连接到数据库的用户都会保持一个ODBC连接,会一直占用中央服务器的资源,对服务器的要求很高。


3)用户

a)没有安装客户端的外部用户不能访问。

b)只有安装了客户端才能访问服务器,所以用户不能随时随地的访问。

c)用户是通过ODBC连接到数据库的,所以用户数受限,不易扩张。

d)由于针对小范围的客户,所以不能实现真正大范围的信息共享,信息传达和发布。


4)开发成本

a)需要聘用高素质的人员,对其培训,费用高。

b)初次开发就需要配备好客户端,服务器,需要有专业水准的技术人员,所以成本高。


5)后期成本

a)系统升级维护麻烦,需要更改大量程序,投入大量精力和金钱。

b)业务扩展或变更时,需要更改程序,客户端的界面也需要重新更改。

c)初次投入成本后不能一劳永逸,后期需要很多成本,比如服务器的更换,客户端的更变等。

四、C/S架构应用

C/S架构的软件是在是数不胜数,从办公的OFFICE,WPS,WINRAR到杀毒软件如金山,瑞金再到我们的娱乐软件,如播放器,QQ,微信等,无处不见C/S架构。


B/S架构

一、B/S架构及其背景

随着Internet和WWW的流行,以往的主机/终端和C/S都无法满足当前的全球网络开放、互连、信息随处可见和信息共享的新要求,于是就出现了B/S型模式,即浏览器/服务器结构。它是C/S架构的一种改进,可以说属于三层C/S架构。主要是利用了不断成熟的WWW浏览器技术,用通用浏览器就实现了原来需要复杂专用软件才能实现的强大功能,并节约了开发成本,是一种全新的软件系统构造技术。


第一层是浏览器,即客户端,只有简单的输入输出功能,处理极少部分的事务逻辑。由于客户不需要安装客户端,只要有浏览器就能上网浏览,所以它面向的是大范围的用户,所以界面设计得比较简单,通用。


第二层是WEB服务器,扮演着信息传送的角色。当用户想要访问数据库时,就会首先向WEB服务器发送请求,WEB服务器统一请求后会向数据库服务器发送访问数据库的请求,这个请求是以SQL语句实现的。


第三层是数据库服务器,他扮演着重要的角色,因为它存放着大量的数据。当数据库服务器收到了WEB服务器的请求后,会对SQL语句进行处理,并将返回的结果发送给WEB服务器,接下来,WEB服务器将收到的数据结果转换为HTML文本形式发送给浏览器,也就是我们打开浏览器看到的界面。


B/S架构和C/S架构不同,浏览器不是直接和数据库服务器相连,所以是多对多的结构。因此在此结构下,很适合在广域网里实现巨大的互联网,甚至是全球网。有着很强大的信息共享性。


在B/S出现的早期,浏览器只能显示静态页面,得不到良好的交互,不能进行大量的逻辑处理,当时浏览器主要用来实现信息的发布,是一种单向的应用。后来出现了动态网页,这里的动态有三个方面,一是交互,二是动画,三是数据。这样,浏览器的交互性能得到极大提高。页面也越来越丰富多彩。浏览器也能处理部分逻辑事务,所以浏览器成为了客户端,但由于处理的内容较少,所以叫“瘦”客户端


二、B/S架构的优点

B/S架构是应WEB技术的飞速发展而从传统的C/S架构发展而来,并且一举成为当今主要的网络架构。目前主要的网站,尤其是商务网站都是基于B/S架构建立的。那么我们就来细数一下B/S架构的优点,它到底为什么受到大家的青睐。
1)浏览器

a)能面对广大的用户实现信息传播共享。

b)浏览器只处理一些简单的逻辑事务,负担小。

c)页面的更新能实现同步,所有用户都能看到。

d)界面设计开发简单,对程序员的要求较低,不需要大量的培训。

e)业务扩展方便,只需要增加几个业务扩展的页面即可,不需要大量的编程。

f)界面不需要太多的编写,比较通用,更改界面也比较简单,所以几乎不需要维护。

g)由于Web的平台无关性,可以从一台服务器、几个用户的工作组级扩展成为拥有成上万用户的大型系统。


2)服务器

a)数据都集中存放在数据库服务器,所以不存在数据不一致现象。

b)能有效地保护数据平台和管理访问权限,服务器数据库也很安全。

c)在数据库服务器上不一定使用WINDOWS系统,选择更多,成本更少。

d)如果是异地,只需要把服务器连接专网即可,实现远程维护、升级和共享。

e)在JAVA这样的跨平台语言出现之后,B/S架构管理软件更是方便、快捷、高效。 

f)数据存放在数据库服务器,客户端并不存放任何业务数据或者数据库连接信息,所以数据比较安全。

g)随着服务器负载的增加,可以平滑地增加服务器的个数并建立集群服务器系统,然后在各个服务器之间做负载均衡。


3)用户

a)B/S建立在广域网上,所需的网速不高。

b)外部的用户也可以对浏览器进行访问。

c)界面人性化,通用化,不需要多少培训就能掌握。

d)不需要安装客户端,只要能连上网,就能随时随地的浏览页面。

e)借助Internet强大的信息发布与信息传送能力可以有效地解决企业内部的大量不规则的信息交流。

f)所有的用户都是通过一个JDBC连接缓冲池连接到数据库的,用户并不保持对数据库的连接,用户数基本上是无限的。


4)成本

a)软件重用性强,节省了大量的成本。

b)不需要安装特殊的软件,客户端几乎零维护。

c)开发简单,升级便捷,人员不需要太多培训,节省了大量的资金。

d)客户端几乎不需要维护,只要盯紧服务器就可以了,所以成本较小。

e)一般只有初期一次性投入成本,有利于软件项目控制和避免IT黑洞

f)建立在广域网之上的, 不必是专门的网络硬件环境,例如电话上网, 租用设备等,成本较小。

三、B/S架构的缺点

虽说B/S架构有很多优越性,但是也不可避免有些缺陷,不然也不会暴发究竟使用哪种架构的口水战。不过,在理论上,既然B/S是C/S的改进版,应该克服了C/S的很多缺陷,所以缺点应该不是很多。下面我们来看看实际上是什么情况。
1)客户端

a)面通用化,不突出个性。

b)页面需要不断地动态刷新,尤其是用户增多,网速慢得情况,很费时。

c)由于不需要安装客户端,客户端易扩展,还有就是外部用户也可以访问,所以B/S面对大量的不可知用户。


2)服务器

a)用户增多时,服务器响应速度慢。

b)功能虽然多样化,但是不能专门化,不能实现复杂的功能。

c)服务器承担着重要的责任,数据负荷较重。一旦发生服务器“崩溃”等问题,后果不堪设想。

四、B/S架构应用

当时在讲解典型的C/S架构时,提到了了常用的QQ软件。现在新出来了一个WEBQQ,从WEBQQ名称中的WEB就不难看出它属于B/S架构,是一种浏览器服务器结构。事实上也是如此,因为WEBQQ根本不需要安装客户端,只需要有浏览器就可以进行聊天交互了。


C/S和B/S

一、C/S和B/S关系概述

B/S架构是从C/S架构改进而来,可以说是三层C/S架构,由此可见两者关系不一般。B/S从C/S中脱离而出,后来随着WEB技术的飞速发展以及人们对网络的依赖程度加深,B/S一举成为当今最流行的网络架构。两种架构都在各自岗位上虎虎生威,它们各有千秋,都是非常重要的网络架构。在响应速度,用户界面,数据安全等方面,C/S强于B/S,但是在业务扩展和适用www条件下,B/S明显胜过C/S。可以这么说,B/S的强项就是C/S的弱项,反之亦然。它们各有优缺点,相互无法取代。


二、C/S和B/S的不同点



1)比较大的差别
1、结构

C/S是两层架构,由客户端和服务器组成,而B/S是三层架构,由浏览器,WEB服务器和数据库服务器组成。


2、逻辑事务处理
C/S架构合理地让客户端和服务器承担一部分逻辑事务处理,使得服务器的负担减轻了,而且客户端也能进行一些数据处理和存储的功能。B/S架构的浏览器就是它的客户端,可是这个客户端只能进行一些简单的输入输出和信息发布共享的功能,主要的逻辑事务处理还是要靠服务器,所以服务器的负担很重。


3、工作原理
C/S架构是客户端和服务器直接相连,实现点对点的通信,B/S是浏览器通过WEB服务器向数据库服务器发送数据请求,实现多对多的通信。


4、响应速度
C/S架构的客户端和服务器直接相连,中间没有任何阻隔,所以相应速度快,尤其是在用户增多时更加明显。B/S架构相应速度慢,主要的重任在数据库服务器身上,由于B/S架构的无限扩展性,当用户激增,访问量庞大时,服务器相应速度慢,服务器存在瘫痪的危险。


5、成本
C/S架构开发时,硬件需要一次性购买,费用较高,且需要训练有素的技术人员,培训费用高,而且软件后期也需要不断投入大量资金。B/S架构只需要一次性投入几乎可以一劳永逸,有利于软件项目控制和IT黑洞。


6、维护、升级以及扩展
C/S架构一旦有业务的变更或要升级,客户端界面就要重新设计,需要投入大量的人力物力。软件维护也比较麻烦,需要专业人士进行维护。用户扩展也比较麻烦,需要安装客户端,对软硬件要求高。B/S架构的维护和升级都非常容易,只要更改页面内容或者增减页面即可,客户端几乎是零维护,只需要维护好服务器。所以相对来说更简易,方便。由于B/S可以随时随地的访问,所以极易扩展。


7、信息共享
C/S架构是建立在局域网之上的,面向的是可知的有限用户,信息共享只在小范围内。B/S架构建立在广域网之上,用户随时随地都可以访问,外部用户也可以访问,尤其是WEB技术的不断发展,B/S面对的是几乎无限的用户群体,所以信息共享性很强。


8、客户端界面
C/S架构可以针对不同的功能设计出不同的很有特色的用户界面,实现个性化。但是一旦业务改变就需要重新设计,很麻烦。B/S架构的用户界面很通用,不能针对用户突出个性,但是业务改变时只需要改变界面内容或者增减页面,很轻松就能实现。


2)小的差别
1、适用的网络
C/S架构是建立在局域网的基础之上的,局域网之间通过专用服务器提供连接提供服务。B/S架构是建立在广域网的基础之上,有更大的使用范围。


2、访问
C/S架构下,用户需要安装客户端才能够访问服务器,而B/S架构下,用户可以随时随地访问,只要有网有浏览器,方便快捷。  


3、数据库连接类型

C/S采用的是ODBC连接,所以只要用户连接了数据库就一直保持连接不会断开,所以限制了用户数,而B/S采用的是JDBC连接,用户并不保持对数据库的连接,所以用户数几乎是无限的。


4、功能
C/S架构能够实现单一的复杂功能,如财政管理等,所以现在大多数比较大型的ERP系统仍是C/S架构,B/S架构的界面比较通用,所能处理的逻辑事务较少,所以功能较弱。


5、安全性
C/S架构建立在局域网之上,面向比较固定的用户,对安全的要求较高。B/S架构建立在广域网上,面对不可知人群,安全性差。


6、信息流向不同
C/S 程序一般是典型的中央集权的机械式处理, 交互性相对低B/S 信息   流向可变化, B-B B-C B-G等信息、流向的变化, 更像个交易中心。


7、对技术人员的要求
C/S的功能比较专业化,对设计和开发人员的要求较高,需要专业的培训。B/S的界面比较人性化,通用化,所以不需要多高的技能。

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325751020&siteId=291194637