DB Topic 7&8 - Database Design &transaction
DB Topic 7&8 - Database Design &transaction
Systems Analysis
Systems Development
Approaches
• Iterative approaches
Database Design Topic 7 - 7.5
Feasibility Study
Systems Analysis
Database Design Topic 7 - 7.6
Iteration
Evaluation
Design and
Analysis Prototyping
Evaluation
Database Design Topic 7 - 7.10
Database Design - 1
Analyst Programmer
Database Design - 2
Moving from a set of requirements
• Conceptual design
• Logical design
• Physical design
https://online.visual-paradigm.com/knowledge/visual-
modeling/conceptual-vs-logical-vs-physical-data-model
Database Design Topic 7 - 7.14
How is this
What data is held? the data
used?
Database Design Topic 7 - 7.15
Logical Design
Design transactions
Database Design Topic 7 - 7.16
Physical Design
• From entities to tables
• Designing the base relations
Indexing Denormalisation
• Logical design
– identifying entities, normalisation
• Physical design
– Move from entities to tables is one of the key activities
here involving what is known as designing the base
relations.
– Also involves indexing, denormalisation, view creation
and query tuning
Database Design Topic 7 - 7.18
Data Dictionary
Domains
Domain StudentType varchar, length 30, must be ‘Overseas’,’Home’
Domain City varchar length 30
Base Relations
student(student_id Number NOT NULL,
address_line1 Varchar (30) NOT NULL
address_line2 Varchar (30) NOT NULL
city City
student_type StudentType NOT NULL DEFAULT ‘Home’
PRIMARY KEY (StudentID)
FOREIGN KEY (City) REFERENCES City (City_name));
Database Design Topic 7 - 7.19
CASE Tools
• Computer Aided Software Engineering
– Design tools
– Documentation tools
– Code generators
• Enable developers to store entity definitions,
domain definitions etc.
• From these, the base relations can automatically
be generated.
• Can also generate the scripts to create the physical
data
Databases
Topic 8: Supporting Transactions
1 0...N 0...N 1
BOAT RENTAL CUSTOMER
1
0...N
DAMAGE
Database Design Topic 7 - 7.23
Transactions
• Transactions are the units of work in a database system.
• ACID: A transaction must be
– Atomic
• either complete in its entirety or have no effect whatsoever
– Consistent
• conform to existing constraints in the database,
– Isolated
• not affect other transactions
– Durable
• it must get written to persistent storage
Database Design Topic 7 - 7.26
Transactions
• Transactions can be made up of one or more
operations. Operations are usually defined as:
• CREATE or INPUT
• RETRIEVE
• UPDATE
CRUD or IRUD
• DELETE
Database Design Topic 7 - 7.27
Identify Transactions
What to Look at
• Transactions that are frequent and could affect the
efficiency and performance of the database
• Critical transactions vital to the running of the business
• Transactions that take place in peak periods
• How to Investigate:
– Look at each transaction and work out what tables it will affect.
– Work out if there are tables that are used by many transactions.
– Look at how the data is affected by the transaction.
Database Design Topic 7 - 7.29
Discussion Session
Transaction/ A B C D E F G H
Relations
Boat
Customer
Rental
Damage
Transaction
A B C D E F G H
/Relations
Boat CD R R R
Customer U CU R R
Rental C R R R
Damage C R
Database Design Topic 7 - 7.32
Attribute Level
Analysing Tranactions
• CRUD
• Does the transaction involve any predicates?
– specific conditions in the where clause
• Attributes
– Which attributes are involved
• Frequency
– It might affect performance. Will the transactions
perform the same during periods of high activity?
Database Design Topic 7 - 7.34
Indexes
• Improve performance
– Transaction time
• Creating entries in a special structure, so that
makes it easier to find a record.
Database Design Topic 7 - 7.36
Performance
Applications
• The software that is used to access the data in
a database...
Websites Forms
Queries Types of
Application
Roles in a System
Grant
Revoke
De-Normalisation
Table 1
View of
selected rows
Table 2
or columns of
these tables
Table 3
Database Design Topic 7 - 7.45
Topic 8 – Supporting
Transactions
Any Questions?