it-e-33 PostgreSQL

PostgreSQL is an object-relational database management system (ORDBMS) based on
POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer
Science Department. POSTGRES pioneered many concepts that only became available in some
commercial database systems much later.
Features PostgreSQL is an open-source descendant of this original Berkeley code. It
supports SQL92 and SQL99 and offers many modern features:
complex queries
foreign keys
triggers
views
transactional integrity
multiversion concurrency control
Additionally, PostgreSQL can be extended by the user in many ways, for exampleby
adding new

data types
functions
operators
aggregate functions
index methods
procedural languages
And because of the liberal license, PostgreSQL can be used, modified, and distributed by
everyone free of charge for any purpose, be it private, commercial, or academic.

Advantages PostgreSQL offers many advantages for your company or business over other
database systems.
1) Immunity to over-deployment
Over-deployment is what some proprietary database vendors regard as their #1 licence
compliance problem. With PostgreSQL, no-one can sue you for breaking licensing agreements,
as there is no associated licensing cost for the software.
This has several additional advantages:
More profitable business models with wide-scale deployment.
No possibility of being audited for license compliance at any stage.
Flexibility to do concept research and trial deployments without needing to include
additional licensing costs.
2) Better support than the proprietary vendors
In addition to our strong support offerings, we have a vibrant community of PostgreSQL
professionals and enthusiasts that your staff can draw upon and contribute to.
3) Significant saving on staffing costs
Our software has been designed and created to have much lower maintenance and tuning
requirements than the leading proprietary databases, yet still retain all of the features, stability,
and performance.
In addition to this our training programs are generally regarded as being far more cost
effective, manageable, and practical in the real world than that of the leading proprietary database
vendors.
4) Legendary reliability and stability
Unlike many proprietary databases, it is extremely common for companies to report that
PostgreSQL has never, ever crashed for them in several years of high activity operation. Not
even once. It just works.
5) Extensible
The source code is available to all at no charge. If your staff have a need to customise or
extend PostgreSQL in any way then they are able to do so with a minimum of effort, and with no
attached costs. This is complemented by the community of PostgreSQL professionals and
enthusiasts around the globe that also actively extend PostgreSQL on a daily basis.
6) Cross platform
PostgreSQL is available for almost every brand of Unix (34 platforms with the latest stable
release), and Windows compatibility is available via the Cygwin framework. Native Windows
compatibility is also available with version 8.0 and above.
7) Designed for high volume environments
We use a multiple row data storage strategy called MVCC to make PostgreSQL extremely
responsive in high volume environments. The leading proprietary database vendor uses this
technology as well, for the same reasons.
8) GUI database design and administration tools

Several high quality GUI tools exist to both administer the database (pgAdmin, pgAccess)
and do database design (Tora, Data Architect).

 

1, teller  ['telə]
n. (美)出纳员;讲述者;讲故事者;计票员

2, reservation  [,rezə'veiʃən]
n. 预约,预订;保留
3, at will 
随意;任意
4, pioneer  [,paiə'niə]
n. 先锋;拓荒者
vt. 开辟;倡导;提倡
vi. 作先驱

5, proprietary  [prə'praiətəri]
a. 专利的(所有的)
n. 所有权(所有人)

6, globe  [gləub]
n. 地球,地球仪,球体

7, volume  ['vɔlju:m; (US) -jəm]
n. 体积,容量,音量
n. 卷,册

Continue reading it-e-33 PostgreSQL

mongoDB 笔记

官网

http://www.mongodb.org

java driver下载:

https://github.com/mongodb/mongo-java-driver/downloads

 

先看

http://www.mongodb.org/display/DOCS/Quickstart

要在windows下安装为service,见

http://www.mongodb.org/display/DOCS/Windows+Service

具体命令是

mongod --port 13668 --logpath D:/mongodb-win32-i386-1.8.1/log/mongo.log --logappend --dbpath D:/mongodb-win32-i386-1.8.1/data --directoryperdb --serviceName MongoDb_181 –install

注意建议不要使用参数 --bind_ip 127.0.0.1 ,这样的话只能通过127.0.0.1来连接,使用局域网ip和localhost则不能连上

对应的删除命令是:

mongod --serviceName MongoDb_181  --remove

如果不需要作为服务,去掉上面的命令中的—install 和 --serviceName  参数即可

即:

mongod  --port 13668 --logpath D:/mongodb-win32-i386-1.8.1/log/mongo.log --logappend --dbpath D:/mongodb-win32-i386-1.8.1/data –directoryperdb

注意文档中有些问题:

--logpath 参数必须是个文件,不能是文件夹

--dbpath 所指向的文件夹必须已经存在,否则安装成功却启动不了,总是重复启动--失败

 

更多命令参数见    --help

突然看到这篇文章:

为什么我们放弃使用MongoDB

说的是比较实际的问题

32为系统文件大小限制,由于底层内存映射的实现造成的。

但是再看看

我为什么选择MongoDB

mongodb使用心得

想想,就当吃吃螃蟹吧。

具体我的体会等用过了再写。

对应的客户端命令则是mongo --port 13668

使用help查看帮助

使用db.help()查看db操作帮助

use 命令可切换到指定数据库,不存在的话就会创建一个,但不是马上创建,而是在插入数据时创建。

使用db.addUser添加用户到某个数据库,注意是指定的数据库,其他的数据库是不存在这个用户的.

关于权限管理可参见 http://blog.csdn.net/a9529lty/archive/2011/05/31/6457279.aspx

 

验证的顺序也是一样,先转到某个数据库,再验证用户。

参见这篇文章快速入门http://blog.sina.com.cn/s/blog_661b4cd50100h8zk.html

使用java 见http://www.mongodb.org/display/DOCS/Java+Tutorial

它的依赖很简单,只要添加驱动依赖包就可以say hello world!了:

>public class HelloWorls { public HelloWorls() { } public static void main(String[] args) { try { Mongo m = new Mongo( "192.168.666.666" , 13668 );

Continue reading mongoDB 笔记

it-e-32 Introduction to DBMS

A database management system (DBMS) is an important type of programming system, used
today on the biggest and the smallest computers. [1]As for other major forms of system software,
such as compilers and operating systems, a well-understood set of principles for database
management systems has developed over the years, and these concepts are useful both for
understanding how to use these systems effectively and for designing and implementing DBMS's.
DBMS is a collection of programs that enables you to store, modify, and extract information
from a database. There are many different types of DBMS's, ranging from small systems that run
on personal computers to huge systems that run on mainframes. The following are the location of
database between application programs and end-users.

There are two qualities that distinguish database management systems from other sorts of
programming systems.
1) The ability to manage persistent data, and
2) The ability to access large amounts of data efficiently.

Point 1) merely states that there is a database which exists permanently; the contents of this
database is the data that a DBMS accesses and manages.

Point 2) distinguishes a DBMS from a
file system, which also manages persistent data. A DBMS's capabilities are needed most when
the amount of data is very large, because for small amounts of data, simple access techniques,
such as linear scans of the data, are usually adequate.
[2]While we regard the above two properties of a DBMS as fundamental, there are a number
of other capabilities that are almost universally found in commercial DBMS's. These are:
Support for at least one data model, or mathematical abstraction through which the user can
view the data.

Support for certain high-level languages that allow the user to define the structure of data,
access data, and manipulate data.
Transaction management, the capability to provide correct, concurrent access to the database
by many users at once.
Access control, the ability to limit access to data by unauthorized users, and the ability to
check the validity of data.
Resiliency, the ability to recover from system failures without losing data.
Data Models Each DBMS provides at least one abstract model of data that allows the user
to see information not as raw bits, but in more understandable terms. In fact, it is usually possible
to see data at several levels of abstraction. At a relatively low level, a DBMS commonly allows
us to visualize data as composed of files.
Efficient File Access The ability to store a file is not remarkable: the file system associated
with any operating system does that. The capability of a DBMS is seen when we access the data of
a file. For example, suppose we wish to find the manager of employee "Clark Kent". If the
company has thousands of employees, It is very expensive to search the entire file to find the one
with NAME="Clark Kent". A DBMS helps us to set up "index files," or "indices," that allow us to
access the record for "Clark Kent" in essentially one stroke no matter how large the file is. Likewise,
insertion of new records or deletion of old ones can be accomplished in time that is small and
essentially constant, independent of the file’s length. Another thing a DBMS helps us do is navigate
among files, that is, to combine values in two or more files to obtain the information we want.
Query Languages To make access to files easier, a DBMS provides a query language, or
data manipulation language, to express operations on files. Query languages differ in the level of
detail they require of the user, with systems based on the relational data model generally
requiring less detail than languages based on other models.

Transaction Management

Another important capability of a DBMS is the ability to
manage simultaneously large numbers of transactions, which are procedures operating on the
database. Some databases are so large that they can only be useful if they are operated upon
simultaneously by many computers: often these computers are dispersed around the country or
the world. The database systems used by banks, accessed almost instantaneously by hundreds or
thousands of automated teller machines (ATM), as well as by an equal or greater number of
employees in the bank branches, is typical of this sort of database. An airline reservation system
is another good example.
Sometimes, two accesses do not interfere with each other. For example, any number of
transactions can be reading your bank balance at the same time, without any inconsistency. [3]But
if you are in the bank depositing your salary check at the exact instant your spouse is extracting
money from an automatic teller, the result of the two transactions occurring simultaneously and
without coordination is unpredictable. Thus, transactions that modify a data item must “lock out”
other transactions trying to read or write that item at the same time. A DBMS must therefore
provide some form of concurrency control to prevent uncoordinated access to the same data item

by more than one transaction.
Even more complex problems occur when the database is distributed over many different
computer systems, perhaps with duplication of data to allow both faster local access and to
protect against the destruction of data if one computer crashes.
Security of Data A DBMS must not only protect against loss of data when crashes occur,
as we just mentioned, but it must prevent unauthorized access. For example, only users with a
certain clearance should have access to the salary field of an employee file, and the DBMS must
be able associate with the various users their privileges to see files, fields within files, or other
subsets of the data in the database. Thus a DBMS must maintain a table telling for each user
known to it, what access privileges the user has for each object. For example, one user may be
allowed to read a file, but not to insert or delete data; another may not be allowed to see the file at
all, while a third may be allowed to read or modify the file at will.

DBMS Types
Designers developed three different types of database structures: hierarchical, network, and
relational. Hierarchical and network were first developed but relational has become dominant.
While the relational design is dominant, the older databases have not been dropped. Companies
that installed a hierarchical system such as IMS in the 1970s will be using and maintaining these
databases for years to come even though new development is being done on relational systems.
These older systems are often referred to as legacy systems.

1, teller  ['telə]
n. (美)出纳员;讲述者;讲故事者;计票员

2, reservation  [,rezə'veiʃən]
n. 预约,预订;保留
3, at will 
随意;任意

Continue reading it-e-32 Introduction to DBMS

业务用例与系统用例的区别

  • 一个业务用例描述的是业务过程——而不是软件系统过程。
  • 一个业务用例为涉众创造价值。这些涉众要么是业务参与者要么是业务工作者。
  • 一个业务用例可以超越组织的边界。有些构架师对于这一点有非常严密的态度。许多业务用例确实超越来组织的边界,但是有些业务用例仅仅关注于一个组织。

 

  • 1.业务用例就是要完成的业务,系统用例是系统要做的事情,两者的域不同。
  • 2.业务建模主要描述了该项目涉及的所有业务,需求模型主要是描述为了满足业务需求系统要做什么,因此,需求模型与业务模型相比,它描述的只是业务模型的一个子集。
  • 3.比方说我们设计一个自动提款机系统,它可以满足用户的取款、改密、查询等需求,那么这些需求就是业务用例;但是用户又分为借记卡用户和信用卡用户,那么根据业务规则,不同的卡用户的取款、改密、查询的过程是不一样的,所以系统为了满足这种业务需求会包含到两个子用例里实现,这种子用例就是系统用例。也就是说系统用例就是系统为了满足这种业务需求要做什么。

 

为什么要区别这些?可能在你的用例图中就混杂了这两种用例。

 

 

参见:

http://www.uml.org.cn/requirementproject/200707024.asp

http://gaojiewyh.iteye.com/blog/408363

http://www.cnblogs.com/rhcad/archive/2010/06/11/1756173.html

Continue reading 业务用例与系统用例的区别

it-e-31 Steganography and Honeytokens

Steganography is a method of embedding electronic messages into a media file (for example, an image or audio file) by altering nonessential lines of code; the changes are imperceptible. The message remains undetected until unencrypted. Honeytokens is any kind of tantalizing false data, including phony patient records at a hospital, lists of invalid social security numbersor even simply a word processing file named "HR-salaries," that's stored in a restricted part of the network. If anyone tries to access the files the security team is alerted to the trespassing before the intruder can do any real damage.

1, imperceptible  [,impə'septəbl]
a. 不能感知的,不知不觉的,微细的

2, steganography  [,stegə'nɔgrəfi]
n. 速记式加密
3, tantalizing  ['tæntəlaiziŋ]
a. 诱人的
4, phony  ['fəuni]
a. 假的,伪造的
5, trespassing 
n. 擅自进入
v. 侵入;犯罪(trespass的ing形式)
6, intruder  [in'tru:də]
n. 侵入者,干扰者,妨碍者

Continue reading it-e-31 Steganography and Honeytokens

ServiceMix环境配置

 

配置使用的ServiceMix版本是servicemix-3.3tomcat5.5以上运行(因为依赖包大部分是需要jdk1.5)

ServiceMix有三种部署方式:单独程序方式,servlet方式,Geronimo and JBoss.整合方式。这里主要介绍servlet方式,因为这样可以整合到任何servlet容器中。

Servlet部署需要在web.xml中配置spring加载文件,这种spring是和xbean整合的自定义配置文件。

 

配置文件说明:

Web.xml

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app

    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

    "http://java.sun.com/dtd/web-app_2_3.dtd">

 

<web-app>

  <display-name>ServiceMix Web Application</display-name>

  <description>Deploys ServiceMix inside a Web Application</description>

 

  <context-param>

    <param-name>contextConfigLocation</param-name>

    <param-value>/WEB-INF/jmx.xml /WEB-INF/core.xml /WEB-INF/activemq.xml</param-value>

  </context-param>

Spring配置文件

  <context-param>

    <param-name>contextClass</param-name>

    <param-value>org.apache.xbean.spring.context.XmlWebApplicationContext</param-value>

  </context-param>

 

  <listener>

    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

  </listener>

Spring 监听器

  <!-- servlet mappings -->

 

  <!-- the main JMX servlet -->

  <servlet>

    <servlet-name>JMXServlet</servlet-name>

    <servlet-class>org.apache.servicemix.web.jmx.JMXServlet</servlet-class>

    <load-on-startup>1</load-on-startup>

  </servlet>

 

  <!--  the HTTP binding servlet -->

 

  <!-- START SNIPPET: servicemix-http-->

  <servlet>

    <servlet-name>HttpManagedServlet</servlet-name>

    <servlet-class>

      org.apache.servicemix.http.HttpManagedServlet

    </servlet-class>

    <load-on-startup>1</load-on-startup>

  </servlet>

http bean组件(BC)servlet

  <servlet-mapping>

    <servlet-name>HttpManagedServlet</servlet-name>

    <url-pattern>/jbi/*</url-pattern>

  </servlet-mapping>

 

  <!-- END SNIPPET: httpBinding -->

 

  <servlet-mapping>

    <servlet-name>JMXServlet</servlet-name>

    <url-pattern>/jmx/*</url-pattern>

  </servlet-mapping>

 

</web-app>

 

demo主要功能的配置在core.xml:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns:sm="http://servicemix.apache.org/config/1.0"

       xmlns:http="http://servicemix.apache.org/http/1.0"

                   xmlns:my="http://servicemix.apache.org/demo/"

       xmlns:foo="http://servicemix.apache.org/demo/">

 

  <!-- the JBI container -->

  <sm:container id="jbi"

      rootDir="#rootDir"

      useMBeanServer="true"

                              createMBeanServer="false"

      MBeanServer="#jmxServer"

      installationDirPath="#installDir"

      deploymentDirPath="#deployDir"

                              monitorInstallationDirectory="true"

      transactionManager="#transactionManager"

      depends-on="broker">

 

    <sm:activationSpecs>

 

      <!--  an example HTTP binding for use by the SpringBindingServlet  -->

      <!-- START SNIPPET: http -->

      <sm:activationSpec componentName="servicemix-http" service="foo:httpBinding" destinationService="foo:echo">

        <sm:component>

          <http:component>

            <http:configuration managed="true" />

            <http:endpoints>

              <http:endpoint service="foo:httpBinding"

                             endpoint="endpoint"

                             targetService="foo:echo"

                             role="consumer"

                             locationURI="http://localhost/exampleUri/

配置url, 会被tomcat自动转换为serverapp/jbi/ exampleUri

"

                             defaultMep="http://www.w3.org/2004/08/wsdl/in-out

消息请求方式是in-out,即期望又返回消息

" />

            </http:endpoints>

          </http:component>

        </sm:component>

      </sm:activationSpec>

使用http BC,作为一个消费者(consumer)目标指向服务引擎(SE)foo:echo

      <!-- END SNIPPET: http -->

 

      <!--  a simple Echo service to test InOut message exchanges using HTTP-->

      <sm:activationSpec componentName="echo" service="foo:echo" >

        <sm:component>

          <bean class="org.apache.servicemix.components.HelloWorldComponent">

            <property name="property" value="name"/>

          </bean>

        </sm:component>

      </sm:activationSpec>

SE foo:echo,这是一个简单的helloworld

</beans>

 

经过这样的配置和在web.xml中配置的servlet,那么uri pattern形如 /jbi/exampleUri请求foo:httpBinding (BC),在ESB内部foo:httpBinding通过消息路由(normalized message router)foo:echo通信

Web测试页面链接为http://localhost:(tomcat端口)/ESB-ServerMix-Web/examples/

 

需要在firefox下测试。

测试页面使用ajax请求/jbi/exampleUri经过foo:httpBinding, foo:echo处理返回信息。

 

 

Continue reading ServiceMix环境配置

【转】几种常见的网络存储技术的比较研究

随着计算网络技术的飞速发展,各种网络服务器对存储的需求随之发展,但由于商业企业规模不同,对网络存储的需求也应有所不同,选择不当的网络存储技术,往往会使得企业在网络建设中盲目投资不需要的设备,或者造成企业的网络性能低下,影响企业信息化发展,因此商业企业如何选择和使用适当的专业存储方式是非常重要的。 
目前高端服务器所使用的专业存储方案有DAS、NAS、SAN、iscsl几种,通过这几种专业的存储方案使用RAID阵列提供的高效安全的存储空间。 
一、直接附加存储(DAS) 
直接附加存储是指将存储设备通过SCSI接口直接连接到一台服务器上使用。DAS购置成本低,配置简单,使用过程和使用本机硬盘并无太大差别,对于服务器的要求仅仅是一个外接的SCSI口,因此对于小型企业很有吸引力。但是DAS也存在诸多问题:(1)服务器本身容易成为系统瓶颈;(2)服务器发生故障,数据不可访问;(3)对于存在多个服务器的系统来说,设备分散,不便管理。同时多台服务器使用DAS时,存储空间不能在服务器之间动态分配,可能造成相当的资源浪费;(4)数据备份操作复杂。 
二、网络附加存储(NAS) 
NAS实际是一种带有瘦服务器的存储设备。这个瘦服务器实际是一台网络文件服务器。NAS设备直接连接到TCP/IP网络上,网络服务器通过TCP/IP网络存取管理数据。NAS作为一种瘦服务器系统,易于安装和部署,管理使用也很方便。同时由于可以允许客户机不通过服务器直接在NAS中存取数据,因此对服务器来说可以减少系统开销。NAS为异构平台使用统一存储系统提供了解决方案。由于NAS只需要在一个基本的磁盘阵列柜外增加一套瘦服务器系统,对硬件要求很低,软件成本也不高,甚至可以使用免费的LINUX解决方案,成本只比直接附加存储略高。NAS存在的主要问题是:(1)由于存储数据通过普通数据网络传输,因此易受网络上其它流量的影响。当网络上有其它大数据流量时会严重影响系统性能;(2)由于存储数据通过普通数据网络传输,因此容易产生数据泄漏等安全问题;(3)存储只能以文件方式访问,而不能像普通文件系统一样直接访问物理数据块,因此会在某些情况下严重影响系统效率,比如大型数据库就不能使用NAS。 
三、存储区域网(SAN) 
SAN实际是一种专门为存储建立的独立于TCP/IP网络之外的专用网络。目前一般的SAN提供2Gb/S到4Gb/S的传输数率,同时SAN网络独立于数据网络存在,因此存取速度很快,另外SAN一般采用高端的RAID阵列,使SAN的性能在几种专业存储方案中傲视群雄。SAN由于其基础是一个专用网络,因此扩展性很强,不管是在一个SAN系统中增加一定的存储空间还是增加几台使用存储空间的服务器都非常方便。通过SAN接口的磁带机,SAN系统可以方便高效的实现数据的集中备份。SAN作为一种新兴的存储方式,是未来存储技术的发展方向,但是,它也存在一些缺点:(1)价格昂贵。不论是SAN阵列柜还是SAN必须的光纤通道交换机价格都是十分昂贵的,就连服务器上使用的光通道卡的价格也是不容易被小型商业企业所接受的;(2)需要单独建立光纤网络,异地扩展比较困难;

四、iSCSI 
使用专门的存储区域网成本很高,而利用普通的数据网来传输SCSI数据实现和SAN相似的功能可以大大的降低成本,同时提高系统的灵活性。iSCSI就是这样一种技术,它利用普通的TCP/IP网来传输本来用存储区域网来传输的SCSI数据块。iSCSI的成本相对SAN来说要低不少。随着千兆网的普及,万兆网也逐渐的进入主流,使iSCSI的速度相对SAN来说并没有太大的劣势。iSCSI目前存在的主要问题是:(1)新兴的技术,提供完整解决方案的厂商较少,对管理者技术要求高;(2)通过普通网卡存取iSCSI数据时,解码成SCSI需要CPU进行运算,增加了系统性能开销,如果采用专门的 iSCSI网卡虽然可以减少系统性能开销,但会大大增加成本;(3)使用数据
网络进行存取,存取速度冗余受网络运行状况的影响。 
    

        通过以上分析,下表总结了这四种方式的主要区别。 
通过以上比较研究,四种方案各有优劣。对于小型且服务较为集中的商业
企业,可采用简单的DAS方案。对于中小型商业企业,服务器数量比较少,有一定的数据集中管理要求,且没有大型数据库需求的可采用NAS方案。对于大中型商业企业,SAN和iSCSI是较好的选择。如果希望使用存储的服务器相对比较集中,且对系统性能要求极高,可考虑采用SAN方案;对于希望使用存储的服务器相对比较分散,又对性能要求不是很高的,可以考虑采用iSCSI方案。

Continue reading 【转】几种常见的网络存储技术的比较研究

【转】回车键触发表单提交的问题


回车键触发表单提交的问题

我们有时候希望回车键敲在文本框(input element)里来提交表单(form),但有时候又不希望如此。比如搜索行为,希望输入完关键词之后直接按回车键立即提交表单,而有些复杂表单,可能要避免回车键误操作在未完成表单填写的时候就触发了表单提交。
要控制这些行为,不需要借助JS,浏览器已经帮我们做了这些处理,这里总结几条规则:
1、如果表单里有一个type=”submit”的按钮,回车键生效。
2、如果表单里只有一个type=”text”的input,不管按钮是什么type,回车键生效。
3、如果按钮不是用input,而是用button,并且没有加type,IE下默认为type=button,FF默认为type=submit。
4、其他表单元素如textarea、select不影响,radio checkbox不影响触发规则,但本身在FF下会响应回车键,在IE下不响应。
5、type=”image”的input,效果等同于type=”submit”,不知道为什么会设计这样一种type,不推荐使用,应该用CSS添加背景图合适些。
实际应用的时候,要让表单响应回车键很容易,保证表单里有个type=”submit”的按钮就行。而当只有一个文本框又不希望响应回车键怎么办呢?我的方法有点别扭,就是再写一个无意义的文本框,隐藏起来 但是如果设置了submit tabindex=0,则会提交  。根据第3条规则,我们在用button的时候,尽量显式声明type以使浏览器表现一致。

Continue reading 【转】回车键触发表单提交的问题

C/S与B/S架构

为了区别于传统的C/S模式,才特意将其称为B/S模式。认识到这些结构的特征,对于系统的选型而言是很关键的。 
1、系统的性能 
在系统的性能方面,B/S占有优势的是其异地浏览和信息采集的灵活性。任何时间、任何地点、任何系统,只要可以使用浏览器上网,就可以使用B/S系统的终端。 
不过,采用B/S结构,客户端只能完成浏览、查询、数据输入等简单功能,绝大部分工作由服务器承担,这使得服务器的负担很重。采用C/S结构时,客户端和服务器端都能够处理任务,这虽然对客户机的要求较高,但因此可以减轻服务器的压力。而且,由于客户端使用浏览器,使得网上发布的信息必须是以HTML格式为主,其它格式文件多半是以附件的形式存放。而HTML格式文件(也就是Web页面)不便于编辑修改,给文件管理带来了许多不便。 
2、系统的开发 
C/S 结构是建立在中间件产品基础之上的,要求应用开发者自己去处理事务管理、消息队列、数据的复制和同步、通信安全等系统级的问题。这对应用开发者提出了较高的要求,而且迫使应用开发者投入很多精力来解决应用程序以外的问题。这使得应用程序的维护、移植和互操作变得复杂。如果客户端是在不同的操作系统上,C/S结构的软件需要开发不同版本的客户端软件。但是,与B/S结构相比,C/S技术发展历史更为“悠久”。从技术成熟度及软件设计、开发人员的掌握水平来看,C/S技术应是更成熟、更可靠的。 
3、系统的升级维护 
C/S系统的各部分模块中有一部分改变,就要关联到其它模块的变动,使系统升级成本比较大。B/S与C/S处理模式相比,则大大简化了客户端,只要客户端机器能上网就可以。对于B/S而言,开发、维护等几乎所有工作也都集中在服务器端,当企业对网络应用进行升级时,只需更新服务器端的软件就可以,这减轻了异地用户系统维护与升级的成本。如果客户端的软件系统升级比较频繁,那么B/S架构的产品优势明显——所有的升级操作只需要针对服务器进行,这对那些点多面广的应用是很有价值的,例如一些招聘网站就需要采用B/S模式,客户端分散,且应用简单,只需要进行简单的浏览和少量信息的录入。 
4、C/S 模式的优点和缺点 
★ C/S 模式的优点 
● 由于客户端实现与服务器的直接相连,没有中间环节,因此响应速度快。 
操作界面漂亮、形式多样,可以充分满足客户自身的个性化要求。 
● C/S结构的管理信息系统具有较强的事务处理能力,能实现复杂的业务流程。
★ C/S 模式的缺点 
● 需要专门的客户端安装程序,分布功能弱,针对点多面广且不具备网络条件的用户群体,不能够实现快速部署安装和配置。 
兼容性差,对于不同的开发工具,具有较大的局限性。若采用不同工具,需要重新改写程序。 
开发成本较高,需要具有一定专业水准的技术人员才能完成。 
5、B/S模式的优点和缺点 
★ B/S 模式的优点 
具有分布性特点,可以随时随地进行查询、浏览等业务处理。 
● 业务扩展简单方便,通过增加网页即可增加服务器功能。 
● 维护简单方便,只需要改变网页,即可实现所有用户的同步更新。 
● 开发简单,共享性强。 
★ B/S 模式的缺点 
● 个性化特点明显降低,无法实现具有个性化的功能要求。 
● 操作是以鼠标为最基本的操作方式,无法满足快速操作的要求。 
● 页面动态刷新,响应速度明显降低。 
● 无法实现本地分页缓存显示,给数据库访问造成较大的压力。 
功能弱化,难以实现传统模式下的特殊功能要求。



c/s,b/s混用
异地查询,浏览等,功能简单,数据量小,安全要求低的可通过b/s实现。
对于数据量大,功能复杂,安全要求高的则使用c/s实现。

Continue reading C/S与B/S架构

Pagination


Total views.

© 2013 - 2019. All rights reserved.

Powered by Hydejack v6.6.1