Top Banner
© 2005 by Prentice Hall © 2005 by Prentice Hall 1 Chapter 9: Chapter 9: The Client/Server The Client/Server Database Environment Database Environment Modern Database Management Modern Database Management 7 7 th th Edition Edition Jeffrey A. Hoffer, Mary B. Prescott, Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden Fred R. McFadden
30

© 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Dec 30, 2015

Download

Documents

Rosamond Bates
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

© 2005 by Prentice Hall© 2005 by Prentice Hall 11

Chapter 9:Chapter 9: The Client/Server The Client/Server

Database EnvironmentDatabase Environment

Modern Database Modern Database ManagementManagement

77thth Edition EditionJeffrey A. Hoffer, Mary B. Prescott, Jeffrey A. Hoffer, Mary B. Prescott,

Fred R. McFaddenFred R. McFadden

Page 2: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 22

ObjectivesObjectives Definition of termsDefinition of terms List advantages of client/server architectureList advantages of client/server architecture Explain three application components: Explain three application components:

presentation, processing, and storagepresentation, processing, and storage Suggest partitioning possibilitiesSuggest partitioning possibilities Distinguish between file server, database server, Distinguish between file server, database server,

3-tier, and n-tier approaches3-tier, and n-tier approaches Describe and discuss middlewareDescribe and discuss middleware Explain query-by-example (QBE)Explain query-by-example (QBE) Explain database linking via ODBC and JDBCExplain database linking via ODBC and JDBC Explain VBA and Microsoft AccessExplain VBA and Microsoft Access

Page 3: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 33

Client/Server SystemsClient/Server Systems

Networked computing modelNetworked computing model Processes distributed between clients Processes distributed between clients

and serversand servers Client – Workstation (usually a PC) that Client – Workstation (usually a PC) that

requests and uses a servicerequests and uses a service Server – Computer Server – Computer

(PC/mini/mainframe) that provides a (PC/mini/mainframe) that provides a serviceservice

For DBMS, server is a database serverFor DBMS, server is a database server

Page 4: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 44

Application Logic in C/S Application Logic in C/S SystemsSystems

GUI Interface

Procedures, functions,programs

DBMS activities

Processing LogicProcessing Logic I/O processingI/O processing Business rulesBusiness rules Data managementData management

Storage LogicStorage Logic Data storage/retrievalData storage/retrieval

Presentation LogicPresentation Logic Input – keyboard/mouseInput – keyboard/mouse Output – monitor/printerOutput – monitor/printer

Page 5: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 55

Client/Server ArchitecturesClient/Server Architectures

File Server ArchitectureFile Server Architecture

Database Server ArchitectureDatabase Server Architecture

Three-tier ArchitectureThree-tier Architecture

Client does extensive processing

Client does little processing

Page 6: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 66

File Server ArchitectureFile Server Architecture

All processing is done at the PC that All processing is done at the PC that requested the data requested the data

Entire files are transferred from the server Entire files are transferred from the server to the client for processingto the client for processing

Problems:Problems: Huge amount of data transfer on the networkHuge amount of data transfer on the network Each client must contain full DBMS Each client must contain full DBMS

Heavy resource demand on clientsHeavy resource demand on clients Client DBMSs must recognize shared locks, integrity Client DBMSs must recognize shared locks, integrity

checks, etc.checks, etc.

FAT FAT CLIENTCLIENT

Page 7: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 77

Figure 9-2: File Server Architecture

FAT FAT CLIENTCLIENT

Page 8: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 88

Two-Tier Database Server Two-Tier Database Server ArchitecturesArchitectures

Client is responsible for Client is responsible for I/O processing logic I/O processing logic Some business rules logicSome business rules logic

Server performs all data storage Server performs all data storage and access processing and access processing DBMS is only on serverDBMS is only on server

Page 9: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 99

Advantages of Two-Tier Advantages of Two-Tier ApproachApproach

Clients do not have to be as Clients do not have to be as powerfulpowerful

Greatly reduces data traffic on the Greatly reduces data traffic on the networknetwork

Improved data integrity since it is Improved data integrity since it is all processed centrallyall processed centrally

Stored proceduresStored procedures some some business rules done on serverbusiness rules done on server

Page 10: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 1010

Advantages of Advantages of Stored ProceduresStored Procedures

Compiled SQL statementsCompiled SQL statements Reduced network trafficReduced network traffic Improved securityImproved security Improved data integrityImproved data integrity Thinner clientsThinner clients

Page 11: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 1111

Figure 9-3: Two-tier database server architecture

ThinneThinner r clientsclients

DBMS DBMS only on only on serverserver

Page 12: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 1212

Three-Tier ArchitecturesThree-Tier Architectures

Thin Client PC just for user interface and a little application

processing. Limited or no data storage (sometimes no hard drive)

GUI interface (I/O processing)

Browser

Business rules Web Server

Data storage DBMS

ClientClient

Application serverApplication server

Database serverDatabase server

Page 13: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 1313

Figure 9-4: Three-tier architecture

Thinnest Thinnest clientsclients

Business rules on Business rules on separate serverseparate server

DBMS only DBMS only on DB serveron DB server

Page 14: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 1414

Advantages of Three-Tier Advantages of Three-Tier ArchitecturesArchitectures

ScalabilityScalability Technological flexibilityTechnological flexibility Long-term cost reductionLong-term cost reduction Better match of systems to business Better match of systems to business

needsneeds Improved customer serviceImproved customer service Competitive advantageCompetitive advantage Reduced riskReduced risk

Page 15: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 1515

Challenges of Three-tier Challenges of Three-tier ArchitecturesArchitectures

High short-term costsHigh short-term costs Tools and trainingTools and training ExperienceExperience Incompatible standardsIncompatible standards Lack of compatible end-user Lack of compatible end-user

toolstools

Page 16: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 1616

Application PartitioningApplication Partitioning

Placing portions of the application Placing portions of the application code in different locations (client vs. code in different locations (client vs. server) AFTER it is writtenserver) AFTER it is written

AdvantagesAdvantages Improved performanceImproved performance Improved interoperabilityImproved interoperability Balanced workloadsBalanced workloads

Page 17: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 1717

Parallel Computer Parallel Computer ArchitecturesArchitectures

Tightly CoupledTightly Coupled Symmetric Multiprocessing (SMP)Symmetric Multiprocessing (SMP) Multiple CPUsMultiple CPUs Shared RAMShared RAM

Loosely CoupledLoosely Coupled Massively Parallel Processing (MPP)Massively Parallel Processing (MPP) Multiple CPUsMultiple CPUs Each CPU has its own RAM spaceEach CPU has its own RAM space

Page 18: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 1818

Parallel Computer Parallel Computer ArchitecturesArchitectures

Figure 9-6Tightly coupled – CPUs share common memory space

Figure 9-7Loosely coupled – CPUs each have their own memory space

Page 19: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 1919

Query Processing with Query Processing with Parallel ProcessorsParallel Processors

Figure 9-5a:Parallel transactions

Figure 9-5b:Parallel query

Page 20: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 2020

Processing Logic Processing Logic DistributionsDistributions

Two-tier distributions

n-tier distributions

Processing logic could be at client, server, or both

Processing logic will be at application server or Web server

Page 21: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 2121

MiddlewareMiddleware

Software which allows an application Software which allows an application to to interoperateinteroperate with other software with other software

No need for programmer/user to No need for programmer/user to understand internal processingunderstand internal processing

Accomplished via Accomplished via Application Application Program InterfaceProgram Interface (API)(API)

The “glue”“glue” that holds client/server applications together

Page 22: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 2222

Types of MiddlewareTypes of Middleware Remote Procedure Calls (RPC) Remote Procedure Calls (RPC)

client makes calls to procedures running on remote computersclient makes calls to procedures running on remote computers synchronous and asynchronoussynchronous and asynchronous

Message-Oriented Middleware (MOM) Message-Oriented Middleware (MOM) asynchronous calls between the client via message queuesasynchronous calls between the client via message queues

Publish/SubscribePublish/Subscribe push technology push technology server sends information to client when available server sends information to client when available

Object Request Broker (ORB)Object Request Broker (ORB) object-oriented management of communications between clients object-oriented management of communications between clients

and serversand servers SQL-oriented Data AccessSQL-oriented Data Access

middleware between applications and database serversmiddleware between applications and database servers

Page 23: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 2323

Database MiddlewareDatabase Middleware ODBCODBC – Open Database Connectivity – Open Database Connectivity

Most DB vendors support thisMost DB vendors support this

OLE-DBOLE-DB Microsoft enhancement of ODBCMicrosoft enhancement of ODBC

JDBCJDBC – Java Database Connectivity – Java Database Connectivity Special Java classes that allow Java Special Java classes that allow Java

applications/applets to connect to applications/applets to connect to databasesdatabases

Page 24: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 2424

Client/Server SecurityClient/Server Security Network environment Network environment complex complex

security issuessecurity issues Security levels:Security levels:

System-level password securitySystem-level password security for allowing access to the systemfor allowing access to the system

Database-level password securityDatabase-level password security for determining access privileges to tables; for determining access privileges to tables;

read/update/insert/delete privilegesread/update/insert/delete privileges Secure client/server communication Secure client/server communication

via encryptionvia encryption

Page 25: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 2525

Query-by-Example (QBE)Query-by-Example (QBE)

Direct-manipulation database languageDirect-manipulation database language Graphical approachGraphical approach Available in MS AccessAvailable in MS Access MS Access translates QBE to SQL and vice MS Access translates QBE to SQL and vice

versaversa Useful for end-user database programmingUseful for end-user database programming Good for ad hoc processing and prototypingGood for ad hoc processing and prototyping

Page 26: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 2626

Figure 9-10: QBE view of a multiple-table join query

Figure 9-12: Equivalent query in SQL

Page 27: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 2727

Figure 9-9: Access usability hierarchy

Foundation of MS Access

Simple processes

Stored modules of pre-existing VBA code

Visual Basic for Applications…language for customizing the application

API to call functions in DLLs external to MS Access

Page 28: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 2828

Using ODBC to Link External Using ODBC to Link External Databases Stored on a Database Databases Stored on a Database

ServerServer Open Database Connectivity (ODBC)Open Database Connectivity (ODBC) API that provides a common language for application programs API that provides a common language for application programs

to access and process SQL databases independent of the to access and process SQL databases independent of the particular RDBMS that is accessedparticular RDBMS that is accessed

Required parameters:Required parameters: ODBC driver ODBC driver Back-end server nameBack-end server name Database nameDatabase name User id and passwordUser id and password

Additional information:Additional information: Data source name (DSN)Data source name (DSN) Windows client computer nameWindows client computer name Client application program’s executable nameClient application program’s executable name

Java Database Connectivity (JDBC) is similar to ODBC – built specifically for Java applications

Page 29: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 2929

ODBC Architecture ODBC Architecture (Figure 9-18)(Figure 9-18)

Each DBMS has its own ODBC-compliant driver

Client does not need to know anything about the DBMS

Application Program Interface (API) provides common interface to all DBMSs

Page 30: © 2005 by Prentice Hall 1 Chapter 9: The Client/Server Database Environment Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,

Chapter 9 © 2005 by Prentice Hall© 2005 by Prentice Hall 3030

Visual Basic for ApplicationsVisual Basic for Applications VBA is the programming language VBA is the programming language

that accompanies Access 2000that accompanies Access 2000 VBA provides these features:VBA provides these features:

Ability to perform complex functionalityAbility to perform complex functionality Error handlingError handling Faster execution than macrosFaster execution than macros Easier maintenanceEasier maintenance OLE automationOLE automation Programmatic controlProgrammatic control Ease of reading for programmersEase of reading for programmers

Event-driven – nonprocedural programming Event-driven – nonprocedural programming that detects events and generates appropriate that detects events and generates appropriate responsesresponses