Docsity

Database Design and Optimization, Slides of Business Administration

Partial preview of the text

Download Database Design and Optimization and more Slides Business Administration in PDF only on Docsity!

Beyond data modeling

  • Model must be normalised – purpose?
  • Outcome is a set of tables = logical design
  • Then, design can be warped until it meets

the realistic constraints of the system

  • Eg: what business problem are we trying

to solve? – see handout [riccardi p. 113, 127]

Realistic constraints

  • Users cannot cope with too many tables
  • Too much development required in hiding

complex data structure

  • Too much administration
  • Optimisation is impossible with too many

tables

  • Actually: RDBs can be quite slow!

Analysis - Three Levels of Schema

Internal Schema

Logical Schema

External Schema 1 External Schema 2 External Schema …

Disk Array

Tables

4 way trade-off

Performance

Clarity of code

Ease of use

Security

Design optimisation

  • Sources of problems:
    • Network traffic
    • Excess CPU usage
  • But physical I/O is greatest threat (different from physical I/O)
  • Disks still the slowest in the loop
  • Solution: minimise or re-schedule access
  • Also try to minimise the impact of Q4 (e.g. mirroring, internal consistency checks…)

Using scenarios for analysis

  • Define standard situation for DB use
  • Analyse their specific requirements
  • Understand the implications for DB design
  • Compare and contrast new problems with

old ones

Manual transaction processing

  • Insurance telemarketing broker
    • Data entry
    • Retrieving reference info
    • Calculations
  • On-line human-computer interaction!!
    • Instant validation (field by field)
    • Drop-down lists (DE accelerators)
  • Quick response time
  • Critical issue = user-friendly front end, but minimise traffic between interface and back end!

Automatic transaction

processing

  • Large number of user performing simple tasks
  • Real-time credit card system (e.g. authorisation) or check out (EPOS)
  • Human interaction at its most simple – eg typing a code or swiping a card
  • Minimum validation, no complex feed back…
  • Large numbers mean potential problems are:
    • Connection opening / closing rate
    • Contention between concurrent users
    • SQL engine pbs + data consistency costs
  • Design with multiple servers

Internet Databases

  • In between types 1 and 2
    • Many concurrent sessions
    • Reduced interaction front end back end
    • Internet = Extra response time (2 secs!)
  • In practice, many sites are quite slow
  • Key issues
    • “thin client”
    • Reduced dialogue
    • Management of sessions (eg coockies) to avoid multiple restarts

High batch throughput

  • Eg mobile phone network operator
  • Real time + huge volume of simultaneous complex transactions - Number checks - Account info - Price info - Pattern checks
  • Large processing capacity required + need to tackle all transactions together in batches - DB query may not be only solution (or quickest) - Move customer account to cache - Copy updated figures for accounts to a log and updated accounts in slack periods (2.5GB an hour!) Docsity.com

Partitioning

  • Oldest trick in the book to speed up retrieval

(eg?)

  • Smaller bunch of data
  • Well labeled so it can be easily found
  • Smaller index
  • Data manipulation – maintenance, copy and

protection far easier

  • Break down big problem (eg table) into small

ones

Conclusion: Key issues

  • At one end: very large numbers of small

transactions

  • Threat of network or process contention
  • At other end: small number of processes

with complex data crunching and time

constraints

  • Design of DB and application must reflect

these constraints