comp283-lecture 1 applied database managementcgi.csc.liv.ac.uk/~phil/teaching/comp283/lecture...

24
COMP283-Lecture 1 Applied Database Management 1 Introduction My Contact Details: Room: Tel: e-mail: Phil Jimmieson Ashton 1.20 (+44/0) 151 795 4236 [email protected] Comp283: Applied Database Management 7.5 credits. Lectures: 10 of 45 minutes. Practicals: 10 of 2 hours.

Upload: others

Post on 26-May-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

AppliedDatabaseManagement

1

Introduction

MyContactDetails: Room: Tel: e-mail:

PhilJimmieson

Ashton1.20(+44/0)[email protected]

Comp283: AppliedDatabaseManagement7.5credits.

Lectures: 10of45minutes.

Practicals: 10of2hours.

Page 2: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

Introduction:PleaseNote

● Thisisapracticalmodule–youshouldmakesureyouattendalllectures,practicalsessionsandcompletealltheassignments

● Arriveatlecturesontimeplease!● Doaskquestions

2

Page 3: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

Introduction:LearningOutcomes

● FormalLearningOutcomes:● Attheendofthemodulethestudentshouldbeableto:

● designandstructureanefficientscalabledatabasesystem,● implementandconfigureadatabasesystem,● maintainasecureanddurabledatabase,● describe,illustrateandexplaintheconceptoflinkeddatabasesanddatamigrationtechniques.

● InformalLearningOutcomes:● Thestudentshouldknowhowtoproducetimelyandprofessionalbusiness

plans,procedures,andreports.● Timemanagementskillswillberequiredfortimelysubmissionofassignments

3

Page 4: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

Introduction:DBandDBMS

●Whatisadatabase?●WhatisaDataBaseManagementSystem(DBMS)?● Asoftwareapplicationthathelpsdefine,store,retrieveandmaintaindataoncomputersystems.

● Isthatallthereistoadatabase?

4

Page 5: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

Introduction:DataModels

● DatabasesandDBMSeachfollowadatamodel:● Flat● Hierarchical● Dimensional● Network● Relational● Entity-relationship● Graph● Object-oriented● Entity-attribute-valuemodel

5

Usuallyasinglefile.Onerecordperlinewithafielddelimiter,e.g.csvfileorfixedlength(padded)fields.

Page 6: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

Introduction:DataModels

● DatabasesandDBMSeachfollowadatamodel:● Flat● Hierarchical● Dimensional● Network● Relational● Entity-relationship● Graph● Object-oriented● Entity-attribute-valuemodel

6

Dataorganisedintoatree-likestructure,singleparent–multiplechildmodel.e.g.folderandfilestructureonacomputer.

Page 7: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

Introduction:DataModels

● DatabasesandDBMSeachfollowadatamodel:● Flat● Hierarchical● Dimensional● Network● Relational● Entity-relationship● Graph● Object-oriented● Entity-attribute-valuemodel

7

SpecialisedRelationalmodeltailoredtodatawarehousingusingOnlineAnalyticalProcessing(OLAP)queries.Dataisorganisedintonumericalfacts(measures)andcategorised(dimensions).Quickandefficientforsummingdataordrillingdowntospecifics,e.g.asalesinvoicecouldbeusedtoindicatethetotalpurchaseprice,butyoucouldthenquerytheitemsbought,wheretheitemwasstored,whereitwasmanufactured…

Page 8: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

Introduction:DataModels

● DatabasesandDBMSeachfollowadatamodel:● Flat● Hierarchical● Dimensional● Network● Relational● Entity-relationship● Graph● Object-oriented● Entity-attribute-valuemodel

8

Dataisorganisedintosetswithaname,anownerandoptionallyareferencetoanotherrelatedset.Thereferenceisalinktotheownedsetofdata.e.gtheWorldWideWebisanetworkeddatabase.AwebpageisdefinedbyitsURL,itcontainsinformationandmayhavelinkstootherwebpages.

Page 9: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

Introduction:DataModels

● DatabasesandDBMSeachfollowadatamodel:● Flat● Hierarchical● Dimensional● Network● Relational● Entity-relationship● Graph● Object-oriented● Entity-attribute-valuemodel

9

Consistsofrelations(tables)ofstructureddata,whereeachtuple(record)hasthesameattributesandconformtothesameconstraints.Thedatacanbeseparatedintoseparatetablesandlinkedusingkeysthatuniquelydefinetherecord.Relationshipsbetweentablesareenforcedusingprimaryandforeignkeysthatarepre-definedandensurecorrespondingattributesofinformationmaintaintheirintegrityandconformtotheconstraints.

Page 10: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

Introduction:DataModels

● DatabasesandDBMSeachfollowadatamodel:● Flat● Hierarchical● Dimensional● Network● Relational● Entity-relationship● Graph● Object-oriented● Entity-attribute-valuemodel

10

Usesentities,relationship,andattributes.Anentitywillhaveoneormoreattributesandwillbedescribedbyitsrelationtoanotherentity.E.gTheentityartistwillhavetheattributes,nameanddateofbirth,theywillhavetherelationshipof“Sang”toanotherentitycalledsongwhichinturnhasanattributeoftitle.Theentity-relationshipisagraphicalwayofdefiningdatasetsandtheirassociations.

Page 11: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

Introduction:DataModels

● DatabasesandDBMSeachfollowadatamodel:● Flat● Hierarchical● Dimensional● Network● Relational● Entity-relationship● Graph● Object-oriented● Entity-attribute-valuemodel

11

Basedongraphtheory.Nodescontainproperties(informationdescribinganentity-thefacts),edgesdescribethelinkandrelationshiptoothernodes.Alotofthefocusisontheseedgesdescribingtherelationship,ratherthanthepropertiesofthenode.Theedgecanbequeriedtolookatsimilarrelationships–notsoeasyinarelationaldatabase.

Page 12: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

Introduction:DataModels

● DatabasesandDBMSeachfollowadatamodel:● Flat● Hierarchical● Dimensional● Network● Relational● Entity-relationship● Graph● Object-oriented● Entity-attribute-valuemodel

12

Informationisstoredasobjects,inanObjectOrientateddatabasetheDBMSismorecloselyincorporatedintothedatamodel.EachobjectconsistsofAttributesandMethods.Attributesconsistofinformation,methodsdefinewhatcanbedonewiththedata.Objectorientateddatabasescanbeusedtostoreanddefinecomplexsystems,e.g.Describeaplane,themodularaspectsarewing,fuselage,tail,engine,etc.

Page 13: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

Introduction:DataModels

● DatabasesandDBMSeachfollowadatamodel:● Flat● Hierarchical● Dimensional● Network● Relational● Entity-relationship● Graph● Object-oriented● Entity-attribute-valuemodel

13

Usedwheretherearepotentiallymanydifferentattributesbutmostofthesearenotrelevant.Thedataforanentityonlyrecordsthepertinentor“not-null”values.e.g.acareersadviceinterviewmayrecordsomestandardattributes:name,dateandtime,butotherattributesmayonlyberecordedforasmallgroupofpeople–hobbiesmightbepaint-ballingandflowerarranging,theirtrainingmightincludetwoyearsinOuter-Mongoliaasayurtbuilder,therelatedskillsanddiscussionwouldberelevanttoveryfewpeople.Awelldefineddatabasewouldbeabletolinktheseactivitieswithasetofrelatedattributes.

Page 14: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

Introduction:DBSystems

● ThiscoursewillbefocussedonRelationalDatabases,primarilyonMySQL.

●WewillhighlightkeysimilaritiesandoutlinenotabledifferencesbetweenMS-SQL,OracleDBMSandMySQL.

14

Page 15: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1DBHardwareDesign

15

Location: Where will the server be located – under a desk or in an ultra-modern, mains monitored, climate controlled, bomb proof server room.

Storage: How much disk space will be required.

Network: What is the network infrastructure. How much data can be transferred. What restrictions (firewalls) are in place. What network protocols will be required.

Processors: What type of processor will be suitable, 32 or 64 bit, PowerPC, Intel family...How many functional processors will be required?

Cost: What is the budget.What are the hidden costs – will it require additional cooling, electricity, support.What are the direct costs – licences, hardware, commissioning, contractors.

Availability: How responsive does it have to be.Should the database be disseminated to different locations – e.g. branch offices.

Reliability: What level of up-time is required, is 99% good enough or should it be 99.9999%

Security: Physical location.On-line access.Number of admin users.Should some corporate databases reside on the same server or should they always be separated.Confidentiality agreements and privacy policies.Regulations.

Page 16: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

DBHardwareDesign:Location

● Location● Storage● Network● Processors● Cost● Availability● Reliability● Security

16

● Where?● Facilities● Services(electricity,water,cooling)

Page 17: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

DBHardwareDesign:Storage

● Location● Storage● Network● Processors● Cost● Availability● Reliability● Security

17

● Assesscurrentstoragecapacity● DiskSpace● Diskthroughput● Locationstoragerequirements

● Calculatefuturestoragerequirements

Page 18: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

DBHardwareDesign:Network

● Location● Storage● Network● Processors● Cost● Availability● Reliability● Security

18

● Examinethenetworktopology(layout).

● Identifybandwidthrestrictions.● Identifypossibleproblemfirewalls.● Identifythenetworksforclientaccess,serverreplicationanddatabackups.

● Howmanyserverinstancesanddatabasescanbesupported?

● Whatnetworkprotocolsmustbesupported?

Page 19: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

DBHardwareDesign:Processors

● Location● Storage● Network● Processors● Cost● Availability● Reliability● Security

19

● ADBMSwillbewrittenforaspecificoperatingsystem(OS)

● BoththeDBMSandtheOperatingSystemwillhavesomeminimumandrecommendedsystemrequirements.

● WhenchoosingaDBMSyouwillalsoneedtochoosetheOSandthendeterminewhichtypeofprocessorwillbesuitable.

● Beawarethata“normal”orrecommendedprocessormaynotmeetfuturerequirements–youmayneedtooverspecifytheprocessor.

Page 20: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

DBHardwareDesign:Costs

● Location● Storage● Network● Processors● Cost● Availability● Reliability● Security

20

● Havetoworktoabudget● Mustbeabletoshowcosteffectiveness● Evaluatealldirectcosts

● Contractorfees● Licencefees● Location/Sitecosts

● Beawareofhiddencosts:● Trainingcosts● Warranty/Maintenancefees● LearningMaterials● Location/Sitecosts● LocationPreparationcosts● Utilitycharges

Page 21: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

DBHardwareDesign:Availability/Reliability

● Location● Storage● Network● Processors● Cost● Availability● Reliability● Security

21

● Availability=Responsiveness● Reliability=Up-time● Clusteringistheprocessofprovidingsomeredundancyorhighavailability.

● Databasescanbemirrored.● Databasescanbedistributed.

Page 22: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

DBHardwareDesign:Security

● Location● Storage● Network● Processors● Cost● Availability● Reliability● Security

22

● Whohasphysicalaccesstothesystems?

● Whois/aretheSystemAdministrators?

● WhowillmanagetheDBMA-theDatabaseAdministrators(DBAs)?

● Whoshouldhaveaccesstothedata?

● Whodoeshaveaccesstothedata?● Howsecureisdatacommunication?● Willthedatabeencryptedwhenstored?

Page 23: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

DBDesign:ResourceConsiderations

● Consolidationistheprocessofcombininghardwareand/orsoftware.

● Adatabaseservercanrunoneormoredatabaseinstances.

● Adatabaseinstancecanrunoneormoredatabaseapplications.

23

Page 24: COMP283-Lecture 1 Applied Database Managementcgi.csc.liv.ac.uk/~phil/Teaching/COMP283/lecture PDFs... · 2018-01-25 · COMP283-Lecture 1 Introduction: Learning Outcomes Formal Learning

COMP283-Lecture1

Conclusion

● Generalintroductiontothiscourse● DefinedtheLearningOutcomes● DefinedwhataDBMSis.● IntroducedgeneralDatabasedesignconsiderations.

24