Lecture 9 - Database Integrity, Security and Distribution
Lecture 9 - Database Integrity, Security and Distribution
1. Integrity
• Integrity support
Database Systems – Consistency
Integrity, Security and – Domain constraints
Distribution – Relation constraints
– Referential integrity
– Named constraints
1
10/15/2014
REVOKE SELECT
ON EMPLOYEE
FROM A3
CSI481 Database systems 11 CSI481 Database systems 12
2
10/15/2014
• Client-Server
– Data and DBMS software are at server Database server
Server-side validation
– Some application software may run at clients Database access
• Distributed Database
– Data spread among many machines on a network
Application server
Business logic
Data processing logic
Database server
Data validation
Database access
Functions of a
Advantages of distribution
Distributed Database System
• Suits distributed applications • Access remote site, transmit queries and data via
e.g. local and global users of banks communication network
• Increased reliability and availability • Keep track of data distribution and replication in
– Reliability is the probability that a system is up at a DDBMS catalogue
particular moment • Devise execution strategies for queries and
– Availability is the probability that the system is transactions on multiple sites
continuously available during the time interval • Decide which replicated copy of data to access
• Data sharing with local control • Maintain consistency of replicated copies
• Improved performance • Recover from individual crashes and new types of
– Smaller transactions and small local database failure
3
10/15/2014
Transaction Processing in
Transparency
Distributed Databases
• A Distributed DBMS aims to make distribution • Transactions are key to effective recovery from
transparent, or invisible to the user failure
• Distribution adds several new modes of failure:
• Database is perceived as a single, logical entity
– Individual message loss
• User doesn't see that the data is fragmented – Failure of a communication link
=> queries look as they would on a monolithic – Failure of a site
database – Network partitioning
• Atomicity must be preserved when related
• User doesn't know where the data is stored updates are carried out in different parts of the
=> might see fragmented data database
CSI481 Database systems 19 CSI481 Database systems 20
Transaction Processing in
The Two-Phase Commit Protocol
Distributed Databases
• Distinguish between: • Used to manage the interaction between
– The global transaction coordinator and participants
– The local transactions into which the global • Preserves atomicity
transaction is decomposed
• Each local transaction may be executed on a • Operates in two phases: voting and decision
separate site Phase 1: Voting
• The global transaction has one site which • Coordinator sends PREPARE message to all
manages it, known as the coordinator participants
• Other sites are participants • Coordinator waits for participants to respond
• When participants are done with their work, they within a timeout period
inform the coordinator
CSI481 Database systems 21 CSI481 Database systems 22
4
10/15/2014
5
10/15/2014