登陆注册
23770800000022

第22章 Database System(1)

4.1 An Introduction of Database

A database-management system (DBMS) consists of a collection of interrelated data and a set of programs to access those data. The collection of data, usually referred to as the database, contains information about one particular enterprise. The primary goal of a DBMS is to provide an environment that is both convenient and efficient to use in retrieving and storing database information.

Database systems are designed to manage large bodies of information. The management of data involves both the definition of structures for the storage of information and the provision of mechanisms for the manipulation of information. In addition, the database system must provide for the safety of the information stored, despite system crashes or attempts at unauthorized access. If data are to be shared among several users, the system must avoid possible anomalous results. The importance of information in most organizations,which determines the value of the database—has led to the development of a large body of concepts and techniques for the efficient management of data.

The storage structure and access methods used by the database system are specified by a set of definitions in a special of DDL called a data storage and definition language? The result of compilation of these definitions is a set of instructions to specify the implementation details of the database schemas--details are usually hidden from the users. A database schema is also specified by DDL. Tile result of compilation of DDL statements is a set of tables that is stored in a special file called data dictionary, or data directory. A data dictionary is a file that contains metadata--that is, data about data. This file is consulted before actual data are read or modified in the database system.

Transaction Management

A transaction is a collection of operations that performs a single logical function in a database application. Each transaction is a unit of both atomicity and consistency. Thus, we require that transactions do not violate any database-consistency constraints. That is, if the database was consistent when a transaction started, the database must be consistent when the transaction successfully terminates. However, during the execution of a transaction, it may be necessary temporarily to allow inconsistency. This temporary inconsistency, although necessary, may lead to difficulty if a failure occurs.

It is the responsibility of the programmer to define properly the various transactions, such that each preserves the consistency of the database. For example, the transactions to transfer funds from account A to account B could be defined to be composed of two separate programs: one that debits account A, and another that credits account B. The execution of these two programs one after the other will indeed preserve consistency. However, each program by itself does not transform the database from a consistent state to a new consistent state. Thus, those programs are not transactions.

Ensuring the atomicity and durability properties is the responsibility of the database system itself——specifically, of the transaction management component. In the absence of failures, all transactions complete successfully, and atomicity is achieved easily. However, due to various types of failure, a transaction may not always complete its execution successfully. If we are to ensure the atomicity property, a failed transaction must have no effect on the state of the database. Thus, the database must be restored to the state in which it was before the transaction in question started executing. It is the responsibility of the database system to detect system failures and to restore the database to a state that existed prior to the occurrence of the failure.

Storage Management

Database typically requires a large amount of storage space. Corporate databases are usually measured in terms of gigabytes or, for the largest databases, terabytes of data. A gigabyte is 1000 megabytes or 1 billion bytes, and a terabyte is 1 million megabytes (1 trillion bytes). Since the main memory of computers cannot store this much information, the information is stored on disks. Data are moved between disk storage and main memory as needed. Since the movement of data to and from disk is slow relative to the speed of the central processing unit, it is imperative that the database system structures the data so as to minimize the need to move data between disk and main memory.

The goal of a database system is to simplify and facilitate access to data.;High-level views help to achieve this goal. Users of tile system should not be burdened unnecessarily with the physical details of the implementation of the system. Nevertheless, a major factor in a user's satisfaction or lack thereof with a database system is that system's performance. If the response time for a request is too long, the value of the system is diminished. The performance of a system depends on what the efficiency is of the data structures used to represent tile data in the database, and on how efficiently the system is able to operate on these data structures. As is the case elsewhere in computer systems, a tradeoff must be made not only between space and time, but also between the efficiency of one kind of operation and that of another.

A storage manager is a program module that provides the interface between the low-level data stored in the database and the application programs and queries submitted to the system. The storage manager is responsible for the interaction with the file manager. The raw data are stored on the disk using the file system, which is usually provided by a conventional operating system. The storage manager translates the various DML statements into low-level file system commands. Thus, the storage manager is responsible for storing, retrieving, and updating of data in the database.

同类推荐
  • 课外英语-晚茶故事飘香(双语版)

    课外英语-晚茶故事飘香(双语版)

    本书主要收录了一些精品散文,全书分为爱的足迹、年华似水、生命乐章等个板块,从不同的方面追忆往昔岁月,展示生活中的点滴表现爱的力量、阐释了爱的真谛。
  • 课外英语-七彩音符常青的爱(双语版)

    课外英语-七彩音符常青的爱(双语版)

    本书收录了世界经典英文歌曲,其中包括常青的爱、昔日恋情、无心快语、克莱门泰等多首脍炙人口的歌曲,每首歌曲都有中英文歌词、语言点解析及注释赏析。
  • 俄语通用国家概况

    俄语通用国家概况

    20世纪90年代初苏联解体后,形成完全独立的15个主权国家。独立后的各共和国主要将自己民族的语言定为国语,但俄语仍作为广泛使用的共同交际语言,有的国家还将俄语法定为该国使用的两种官方语言之一。
  • 社会交际口语

    社会交际口语

    口语交际是一种教学策略和方式,是听话、说话能力在实际交往中的应用,听话、说话是口语交际的重要组成部分,但我们不能把口语简单地等同于听话、说话,它不包括交际过程中分析、综合、判断、推理、概括、归纳等思维能力,分析问题和解决问题的能力,实际操作能力,创造能力等,在口语交际训练中只有让学生多种感观都参与到活动中来,才能切实提高口语表达能力。
  • 英语情态卫星副词与语篇中的情态补充

    英语情态卫星副词与语篇中的情态补充

    本书力图在系统功能语言学的人际元功能框架下,通过定性定量的综合法探讨英语语篇中的情态卫星副词和情态补充。
热门推荐
  • 天刀大少

    天刀大少

    武夺,现世的一名历史教师,在一场雷雨中意外被闪电劈死,穿越回大宋年间一个大少身上。但这哪是那个历史书中描述的大宋!这里有妖居于深山荒野,有魔出没地底深渊!这里大小豪阀割据,朝野混乱,何谈杯酒释兵权?征方腊,讨杨幺,与岳飞称兄道弟;灭奸党,逐金贼,携美妻纵游江湖;斩妖孽,除魔王,持天刀上天入地;天刀九转,现天刀,我就是武家大少,看我天刀狂舞,在这乱世劈出一块朗朗晴天。
  • 北梦琐言

    北梦琐言

    本书为公版书,为不受著作权法限制的作家、艺术家及其它人士发布的作品,供广大读者阅读交流。
  • 冰魄天尊

    冰魄天尊

    本书因为是小龙第一次写书,文笔不够好已经断更,按照同样的写作模板和崭新的文风发布了新书《冰绝天尊》,隐藏背景故事相同的情况下调整了冲突的并发性,希望大家喜欢。
  • 让地狱开满鲜花的男人

    让地狱开满鲜花的男人

    一叶扁舟,一指江河,一处世界,一篇随笔......而已。
  • 重生之晓之宇情

    重生之晓之宇情

    重生回到的六岁的唐晓晓,附带空间系统,从此改变命运。守住亲情,带着家人发家致富,拒绝白眼狼的亲戚,开启女神学霸系统。爱情康光大道,某片段:某只无耻卖萌道”晓晓,我这辈子就认定你了,你不能辜负了我。所以你不可以去见他“,看着手机上的已挂断的通话显示,某女无语的瞟了一眼,“江允杰,说B大要我和他回去演讲”“不管,我不许!”某男继续无耻的撒着脚丫子扒着某女不放,“好吧,你晚上睡客房去”“······”
  • 情乱君心妃子笑(妃子笑系列)

    情乱君心妃子笑(妃子笑系列)

    她以和亲公主的身份来到他身边,却已是心有所属。以为只要拥有她的身躯,哪怕她的接近是居心叵测,别具机心。然而她的心却似越藏越深,教他怎么也无法探究,更无从捕捉。他一心想要放开她,阴差阳错,她还是回到了他身边,这一次,他从她身上得到的究竟是求之不得的折磨,还是她愈渐真心的感情?天公不作美,他们的纠缠游戏方才告一段落,于家国战事当前,他们又再成敌人,她明明可以取他性命,可怎么却哭了?
  • 皇家学院:校草独家首爱

    皇家学院:校草独家首爱

    她是千家二小姐,性格冰冷腹黑,她和闺蜜们创造了世界第一大帮绝情帮,还创建了世界第一集团绝帝。回国竟然被父亲拿去上学,重要的还是琉璃皇家学院?哈,看她和闺蜜们女扮男装乱闯琉璃皇家学院,翻了个底朝天,啥?还荣获了个冰山王子?
  • 极品男色,妻主太萌

    极品男色,妻主太萌

    这是一个无意中获得某种异能的萌女,悲催的掉入古代男伶馆的轻松诙谐故事。俗话说的好,历史陈阿娇,那是金屋藏娇的开山鼻祖。她也自称阿娇,不过很可惜,她姓焦名佩。谁能想象一个以长发为美的女尊世界。一个剪着娃娃头的圆脸小可爱,她背着大包头盘黑猫,就掉入了一个满是绝色的男伶馆?(本文纯属虚构,请勿模仿。)
  • 带刺的白百合

    带刺的白百合

    因为一次网络意外,傲慢的女大学生倪佟坠入情网。从最初好奇慢慢过渡到习惯,然后喜欢,最后爱上,貌似这是恋爱最简单不过的必经之路,然而,倪佟却必须面对种种的是与非,对与错,她到底是如何走完这条畸形的初恋之道的呢?80后的青春疼痛着,成长着。。。。
  • 盛宠:次元男神好高冷

    盛宠:次元男神好高冷

    她故意一脸嫌弃:你的情商好低哦!他却一本正经的宣布:从婴儿到坟墓,你的人生福利我包了!