Presentation is loading. Please wait.

Presentation is loading. Please wait.

Architecture & Data Models

Similar presentations


Presentation on theme: "Architecture & Data Models"— Presentation transcript:

1 Architecture & Data Models
Data Abstraction: Data abstraction means the details of data storage are hided from the users who do not need them. Levels of Abstraction: 1. Physical level: Describes how a record (e.g., customer) is stored. 2. Logical level: Describes data stored in database, and the relationships among the data. 3. View level: Application programs hide details of data types. Views can also hide information (such as an employee’s salary) for security purposes.

2

3 Database Schema: The description of a database is called as database schema. I t is specified during database design. It includes the descriptions of the database structure and the constraints that should hold on the database. It is not expected to change frequently. Schema Diagram: A diagrammatic display of (some aspects of) a database schema is called schema diagram.

4 Database Instance/Database State:
The actual data stored in a database at a particular moment in time is called as database instance , database state or database occurrence. Schemas VS Instances: The database schema changes very infrequently . The database state changes every time the database is updated . Schema is also called intension, whereas state is called extension.

5 DBMS 3 - Tier Architecture:

6 In this DBMS architecture, schemas can de defined in three levels: 1
In this DBMS architecture, schemas can de defined in three levels: 1. Internal level. 2. Conceptual level. 3. External level. 1. Internal Level: The internal level has an internal schema. It describes the physical storage structure of the database. The internal schema uses physical data model, which describes the complete details of data storage, access paths for the database, and how the data’s are retrieved or inserted in the database.

7 The conceptual level has a conceptual schema.
It describes the whole database for different users who access the database. The conceptual schema hides the details of the physical storage structures and concentrates basically on entities, relationships, and constraints. 3. External Level: External level includes a number of external schemas or user views. Each external schema describes the part of the database that a particular user group is interested in and hides the rest of the database from that user groups.

8 The three schemas are only descriptions of data.
The data actually exists is at the physical level. DBMS transforms users request specified on an external schema into a request against the conceptual schema and then into a request against internal schema for processing over the database. The request and retrieval must be reformatted to match user’s external view. The process of transforming requests and results between levels are called mappings.

9 Data Independence: Data independence is the defined as the capacity to change the schema at one level of database system without having to change the schema at next higher level. There are two types of data independence: Logical Data Independence: The capacity to change the conceptual schema without having to change the external schemas and their application programs. Physical Data Independence: The capacity to change the internal schema without having to change the conceptual schema.

10 It is used to achieve the abstraction.
Data Models: Data model is defined as a set of concepts to describe the structure of a database, and certain constraints that the database should obey. It is used to achieve the abstraction. In other words data model is a collection of tools for describing: i.e. structure includes Data Data relationships Data consistency constraints Database Operations. 4.1. Basic Operations: operations for retrievals and updates on the database. 4.2. User defined Operations: Operations as compute_sum, Compute_percentage etc. student object. This provides dynamic aspect or behaviour of d/b appln

11 High Level / Conceptual / object based data model:
Categories of data model: High Level / Conceptual data model. Low Level/ Physical data model. Representational/ Implementation data model. High Level / Conceptual / object based data model: High level provides concepts that are close to the way many users perceive data. It uses concepts such as Entities, Attributes and Relationships.

12 Low Level/ Physical data model:
Physical data model describes how data is stored in the computer by representing information such as record formats, record orderings and access path. Representational / Implementation/Record based data model: These data models are used most frequently. They include Hierarchical data model, Network data model and Relational data model.

13 Data Model It is defined as an integrated collection of concepts for describing and manipulating data, relationships between data and constraints on the data in an organisation. It is composed of 3 components. Structural Part: It consists of a set of rules according to which databases can be constructed. Manipulative part: It includes the operations that are used for updating or retrieving data from the database and for changing the structure of the database. Integrity rules: a set of rules which ensures that the data is accurate.

14 Hierarchical Data Model:
The hierarchical data model organizes data in a tree structure. First it was developed by IBM. Data is viewed as collection of relation(also called as segments) There is a hierarchy of parent and child data segments. This structure implies that a record can have repeating information, generally in the child data segments. Data is a series of records, which have a set of field values attached to it. It collects all the instances of a specific record together as a record type. These record types are the equivalent of tables in the relational model, and with the individual records being the equivalent of rows.

15 To create links between these record types, the hierarchical model uses Parent Child Relationships.
These are a 1:N mapping between record types. This is done by using trees. For example, an organization might store information about an employee, such as name, employee number, department, salary. The organization might also store information about an employee's children, such as name and date of birth. The employee and children data forms a hierarchy, where the employee data represents the parent segment and the children data represents the child segment.

16 If an employee has three children, then there would be three child segments associated with one employee segment. In a hierarchical database the parent-child relationship is one to many. This restricts a child segment to having only one parent segment. Hierarchical DBMSs were popular from the late 1960s to 1070s.

17 The segment without a parent is called Root.
The segments that have no child are called as the leaves of the hierarchical model.

18 Application of Hierarchical
These models are widely used s semantic models in practice because many real world phenomenon are hierarchical in nature like administrative structure, biological structure, political and social structures. These models are widely used as a physical model because of hierarchical structure of the disk storage systems like tracks, cylinders and so on.

19 Advantages Simplicity- logically simple relationships
Data sharing- all data are held in a common database, data sharing is possible. Data security- it is the first model to offer data security. Data integrity- parent child relationship is there. so link bet them. The child segments are always automatically referred by its parent. Efficiency- It is efficient when large data is there and it is 1:N relationship are there. When many transactions are there.

20 Disadvantage Implementation complexity-Model is conceptually simple but difficult and complex to implement. d/b designers should have good knowledge of physical data storage. Inflexibility- Lacks flexibility. The changes in new relations lead to complex system. A deletion of one segment leads to deletion of all the segments under it. such error becomes costly. D/B management problem- changes in structure of D/B leads to changes in application program to access D/B. so maintenance is difficult. Operational anomalies'- Insert, update, delete is complex and retrieval is complex. So not suitable for this model.

21 Network Model: The popularity of the network data model coincided with the popularity of the hierarchical data model. Some data were more naturally modeled with more than one parent per child. i.e. ability to handle many: many relationship So, the network model permitted the modeling of many-to-many relationships in data. In 1971, the Conference on Data Systems Languages (CODASYL) formally defined the network model. The basic data modeling construct in the network model is the set construct. A set consists of an owner record type, a set name, and a member record type. A member record type can have that role in more than one set, hence the multiparent concept is supported.

22 Two types of records: owner record and member record
Two types of records: owner record and member record. An owner record type can also be a member or owner in another set. This model allows a record to appear as member in many sets thus allowing M:M relation. The data model is a simple network, and link and intersection record types may exist, as well as sets between them . Thus, the complete network of relationships is represented by several pair wise sets; in each set some (one) record type is owner (at the tail of the network arrow) and one or more record types are members (at the head of the relationship arrow). Usually, a set defines a 1:M relationship, although 1:1 is permitted. The CODASYL network model is based on mathematical set theory.

23 Level 1 owner / Member Level 0 owner Level 1 owner / Member
A B D E C F Level 0 owner Level 1 owner / Member B has only one owner A E has 2 owners B and C Each link between 2 record types represents 1: M Lateral as well as top down connections. It allows1:1, 1:M, M:N Avoids data redundancy problem It supports paths to the same record. Level 2 Member

24 advantages Simplicity: it is simple and easy to design same as hierarchical model. Capable of handling more relationship types-1:1, 1:M, M:N Easier data access- flexible and easier data access. appln can access owner record and all the member records. Data Integrity- it does not allow a member to exist without owner. user must define the owner record and then the member record. So data integrity is maintained. Data independence- network model is better in isolating the programs from the complex physical storage. Database standards- standard is formulated by DBTG It also includes DDL and DML Database task group- 1960

25 Disdavantages System complexity - all the records are maintained using pointers so whole d/b is complex Operational anomalies - implementation is complex because of pointers Not user friendly Absence of structural independence - data access method is navigation system. So changes in structure are difficult to handle. Changes in structure lead to changes application program.

26 Relational Model RDBMS is a database based on the relational model developed by E.F. Codd. A relational database allows the definition of data structures, storage and retrieval operations and integrity constraints. In such a database the data and relations between them are organized in tables. A table is a collection of records and each record in a table contains the same fields. Data items are grouped in one or more independent tables that can be related to one another by using field common to each related table. It allows to describe data with its natural structure only.

27 Certain fields may be designated as keys, which means that searches for specific values of that field will use indexing to speed them up. Where fields in two different tables take values from the same set, a join operation can be performed to select related records in the two tables by matching values in those fields. As these relationships are only specified at retrieval time, relational databases are classed as dynamic database management system. The RELATIONAL database model is based on the Relational Algebra. It used to decompose complex logical structure

28 Relational consists of 3 components-
Set of relations and set of domains that define the data structure Integrity rules that define procedure to protect data. The operations that can be performed on data. Properties of Relational Tables: Values Are Atomic. Each Row is Unique and corresponds to record. Column Values Are of the Same Kind. Columns are attributes The Sequence of Columns is Insignificant The Sequence of Rows is Insignificant Each Column Has a Unique Name. Each column takes values from collection of values known as domain The Degree of relation is the number of attributes it contains. The rows of relations are called TUPLES.

29 Characteristics The whole data is conceptually represented as an orderly arrangement of data into rows and columns called relation or table. All values are scalar- at any given row/column position in the relation there is only one and one value. All operations are done on entire relation

30 Advantages Simple- physical data storage details are not required to designers. No anomalies- no insert update delete anomalies. Structural independence Easier design, implementation, maintenance , usage- Better query capability- 4GL language SQL

31 Disadvantages Hardware overheads- powerful computing hardware and storage devices to perform are required. Easier to design- no internal structure of storage is required to design. This may lead to poor database design. SQL does not provide an efficient way to browse alphabetically.

32 Object/Relational Model:
Object/relational database management systems (ORDBMSs) add new object storage capabilities to the relational systems at the core of modern information systems. These new facilities integrate management of traditional fielded data, complex objects such as time-series and geospatial data and diverse binary media such as audio, video, images, and applets. By encapsulating methods with data structures, an ORDBMS server can execute complex analytical and data manipulation operations to search and transform multimedia and other complex objects.

33 Object-Oriented Model:
Object DBMSs add database functionality to object programming languages. They bring much more than persistent storage of programming language objects. Object DBMSs extend the semantics of the C++ and Java object programming languages to provide full-featured database programming capability, while retaining native language compatibility. A major benefit of this approach is the unification of the application and database development into a seamless data model and language environment. As a result, applications require less code, use more natural data modeling, and code bases are easier to maintain. Object developers can write complete database applications with a modest amount of additional effort.

34 Data Definition Language DDL. Storage Definition Language SDL
Database Languages: Data Definition Language DDL. Storage Definition Language SDL View Definition Language VDL Data Manipulation Language DML High level or nonprocedural DML. (set at a time) Low level or Procedural DML. (Record at a time)

35 DBMS Interfaces: Menu Based interfaces for browsing. Forms based interfaces. Graphical user interfaces. Natural language interfaces. Interfaces for parametric users. Interfaces for the DBA.


Download ppt "Architecture & Data Models"

Similar presentations


Ads by Google