Presentation is loading. Please wait.

Presentation is loading. Please wait.

CST203-2 Database Management Systems Lecture 2. One Tier Architecture Eg: In this scenario, a workgroup database is stored in a shared location on a single.

Similar presentations


Presentation on theme: "CST203-2 Database Management Systems Lecture 2. One Tier Architecture Eg: In this scenario, a workgroup database is stored in a shared location on a single."— Presentation transcript:

1 CST203-2 Database Management Systems Lecture 2

2 One Tier Architecture Eg: In this scenario, a workgroup database is stored in a shared location on a single machine Beneficial when we are dealing with data that is relevant to a single user

3 Client / Server architecture System functionality is distributed between Client module Server module

4 3 tier architecture To ensure more security and load balancing for a greater stability

5 Data models A collection of concepts that can be used to describe the structure of a database “An integrated collection of concepts for describing data, relationships between data, and constraints on the data. Database Solutions: A Step-by-step approach to building databases Include a set of basic operations for specifying retrievals and updates on db

6 Categories of Data Models High-level or Conceptual Data models Low-level or physical data models Representational or implementation data models Relational data model Network data model Hierarchical data model

7 Levels of Abstraction Physical level describes how a record (e.g.: customer) is stored. Logical level: describes data stored in database, and the relationships among the data. type customer = record name : string; street : string; city : integer; end; View level: application programs hide details of data types. Views can also hide information (e.g., salary) for security purposes.

8

9 Database Schema The logical structure of the database Eg: the database consists of information about a set of customers and accounts and the relationship between them

10 Database Instance The actual content of the database at a particular point in time

11 Three Schema Architecture

12 The external schema Defines one view of data as seen by a specific set of applications or end users The conceptual schema Defines data from perspective of system designer Independent of end users and data storage mechanism The internal schema Defines how data is organized, stored and manipulated in the application itself Totally dependent on particular implementation

13 Data Independence Logical Data Independence Physical Data Independence

14 Entity Represents a real world object or concept Eg: an employee, a project

15 Attribute Represents some property of interest that further describes an entity Eg: employee’s name or salary

16 Relationship Represents an association among 2 or more entities Eg: an employee works on a project

17 Example of schema in the entity-relationship model

18 A Sample Relational Database

19 Data Definition Language (DDL) Specification notation for defining the database schema E.g. create table account ( account-number char(10), balance integer) DBMS have a DDL compiler Data dictionary contains metadata (i.e., data about data) Database schema Data storage and definition language language in which the storage structure and access methods used by the database system are specified Usually an extension of the data definition language

20 Data Manipulation Language (DML) Language for accessing and manipulating the data organized by the appropriate data model DML also known as query language Two classes of languages Procedural – user specifies what data is required and how to get those data Nonprocedural – user specifies what data is required without specifying how to get those data SQL is the most widely used query language

21 SQL SQL: widely used non-procedural language E.g. find the name of the customer with customer-id 192-83-7465 select customer.customer-name from customer where customer.customer-id = ‘192-83-7465’ E.g. find the balances of all accounts held by the customer with customer-id 192- 83-7465 select account.balance from depositor, account where depositor.customer-id = ‘192-83-7465’ and depositor.account-number = account.account-number Application programs generally access databases through one of Language extensions to allow embedded SQL Application program interface (e.g. ODBC/JDBC) which allow SQL queries to be sent to a database

22 Transaction Management A transaction is a collection of operations that performs a single logical function in a database application Transaction-management component ensures that the database remains in a consistent (correct) state despite system failures (e.g., power failures and operating system crashes) and transaction failures. Concurrency-control manager controls the interaction among the concurrent transactions, to ensure the consistency of the database.

23 Example: Consider a possible interleaving This is OK. But what about this ??????? T1: A=A+100, B=B-100 T2: A=1.06*A, B=1.06*B T1: A=A+100, B=B-100 T2: A=1.06*A, B=1.06*B

24 Storage Management 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 to the following tasks: Interaction with the file manager Efficient storing, retrieving and updating of data

25


Download ppt "CST203-2 Database Management Systems Lecture 2. One Tier Architecture Eg: In this scenario, a workgroup database is stored in a shared location on a single."

Similar presentations


Ads by Google