Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Models Files and models Copyright © 2003-2016 Curt Hill.

Similar presentations


Presentation on theme: "Database Models Files and models Copyright © 2003-2016 Curt Hill."— Presentation transcript:

1 Database Models Files and models Copyright © Curt Hill

2 Then and Now In the olden days (prior to 1980) there were three major database models Relational Hierarchical Network Each of these had commercial examples In the new millennium there are several new ones as well Copyright © Curt Hill

3 Models Olden days More recently add: Relational Hierarchical Network
Key Value Columnar Document Graph More to come? Copyright © Curt Hill

4 File Structures In the olden days database were classified by their file structures Now we mostly hide the file structure The relational model only needs sequential files, but always uses stronger file structures Copyright © Curt Hill

5 Indexed Files Require links between records The link is a disk address
Either Cylinder, Track, Sector Or Block number The links connect the indices with their corresponding data This complicates their support Copyright © Curt Hill

6 Index Sequential File Tree
Charles Kline Roberts Zane Charles Kline Roberts Zane Abel Bag Casey Charles Able Bart Calvin Charles Dean Easy Frank Kline Larry Morris Roberts Smith Taylor Vernon Zane Easy Frank Jam Kline Leestra May Roberts Singer Smith Taylor Vernon Zane Each block should represent one disk block, such as a sector The top level contains the keys only The bottom level contains key and data We can sequentially process the bottom level to get all names We can randomly enter the tree and find any name with just two accesses Copyright © Curt Hill

7 Relationship types Expresses the cardinality or arity of the relationship One to one One to many Many to many Copyright © Curt Hill

8 Relational Form is that of a table Each table has Row is a record
A fixed number of columns A variable number of rows Row is a record Column contains all the fields of one type Copyright © Curt Hill

9 Relational Currently the dominant model
Substantial theoretical foundation Many very popular implementations Oracle, SQLServer, Postgres, MySQL Has the most popular query language Structured Query Language (SQL) Copyright © Curt Hill

10 Relational Picture Copyright © Curt Hill

11 Relational Model Files
Simplest theoretical file structure Collection of sequential files There are no links needed in a sequential file Implied one to one between adjacent rows This gives the DBMS the choice of how to implement Performance issues if the DBMS only uses sequential files Copyright © Curt Hill

12 Relational Model They are fair to any view, not favoring one over the other Have the best theoretical underpinning Relational algebra and calculus Great amounts of research The only redundancy should be linking keys Copyright © Curt Hill

13 Hierarchical Form is that of a tree
Only the one to many link is allowed Typically favors one particular view of the data Least popular model Some redundancy is present because only one pointer may refer to a node IMS by IBM for mainframes, SAS Institute’s System 2000 Copyright © Curt Hill

14 Hierarchical Model A.J. Baker 101 College St Asst. Prof Barb Jones
2401 Central Ave Assoc. Prof Hist 202 Hist 341 CS 122 CS 161 CIS 385 1028 1158 1032 1021 1026 1058 1144 1298 1036 1026 1416 1591 1428 1126 1028 Copyright © Curt Hill 1416

15 Network Model Examples: VAX DBMS (later acquired by Oracle)
Similar to hierarchical Linked objects Now allow many to many links Now possible to start in different places and still find what is needed Favors more views but not all The many links does complicate maintenance Virtually all redundancy may be eliminated with this model The links keep us from needing two copies of a key Examples: VAX DBMS (later acquired by Oracle) Copyright © Curt Hill

16 More on Network Model The database is often organized in owner-member chains An owner is the head of chain The members are chained together The network is woven together with many such chains Instead of a object pointing at many items it points at the head of a chain of items Copyright © Curt Hill

17 Network Model A.J. Baker 101 College St Asst. Prof Barb Jones
2401 Central Ave Assoc. Prof Hist 202 Hist 341 CS 122 CS 161 CIS 385 1028 1158 This still needs some work to redo the owner-member chains 1032 1021 1026 1058 1144 1298 1036 1026 1416 1591 1428 1126 1028 Copyright © Curt Hill 1416

18 Weren’t There Just Three?
The three models store mostly ASCII text: Numbers Strings Things that could be displayed using a typewriter There are many other types of data Graphics Audio recordings Video Copyright © Curt Hill

19 Object-Oriented Programming
Early days: data as something to be manipulated by external programs In the 80s and 90s object oriented programming paradigm became standard Now: data is part of an object Object encapsulates both the raw data and the operations used to manipulate it Data is not directly accessible Copyright © Curt Hill

20 Object Example Automobile accelerator pedal is data
Cruise control is an object Data: Velocity Position of accelerator Brake Operations: Set Coast Disable Copyright © Curt Hill

21 Object Oriented Database
Next step or not? Want to store data that DB does not know how to manipulate Not always ASCII text The solution is a program with persistent (disk based) data The problem is that this approach cuts itself off from the theory base Copyright © Curt Hill

22 Object Relational Database
Introduce object support into relational database Typical RDB may be accessed by a text based client program, as well as application programs The usual support for unusual data is the BLOB Binary Large OBject We retain the virtues of relational model But, there is very little that can be done with the BLOB, other than access Copyright © Curt Hill

23 NoSQL No SQL or Not Only SQL Relaxation of relational DB principles
Usually a key-value store Often used for the massive data sets that cause performance issues for relational and other models This group needs the theoretical foundation that relational has Will consider much later Copyright © Curt Hill

24 Key Value Simplest model
There is a key (which must be unique) linked to a group of values It gets more interesting if the values may include key value pairs as well Two examples: Riak and Reddis Copyright © Curt Hill

25 KV Picture Copyright © Curt Hill

26 Columnar A lot of similarity to relational, but the dominant item is the column not the row We lack rectangularity that relational has Columns are stored together Halfway between Relational and Key Value HBase, Cassandra, HyperTable are examples Copyright © Curt Hill

27 Columnar Copyright © Curt Hill

28 Document The basic object is now a document instead of a simple field like a number Each document has an ID and other identifying values Examples: MongoDB and CouchDB Copyright © Curt Hill

29 Graph A mathematical graph consists of nodes (the data) and links between these Used for highly interconnected data Processing rides the links NeoJ is an example Copyright © Curt Hill


Download ppt "Database Models Files and models Copyright © 2003-2016 Curt Hill."

Similar presentations


Ads by Google