11
Chapter 9:Chapter 9:The Client/Server The Client/Server
Database EnvironmentDatabase Environment
22Chapter 9
Client/Server SystemsClient/Server Systems Networked computing modelNetworked computing model Processes distributed between clients and Processes distributed between clients and
serversservers Client – Workstation (usually a PC) that Client – Workstation (usually a PC) that
requests and uses a servicerequests and uses a service Server – Computer (PC/mini/mainframe) Server – Computer (PC/mini/mainframe)
that provides a servicethat provides a service For DBMS, server is a database serverFor DBMS, server is a database server
33Chapter 9
Application Logic in C/S Application Logic in C/S SystemsSystems
Presentation LogicPresentation Logic• Input – Input –
keyboard/mousekeyboard/mouse• Output – Output –
monitor/printermonitor/printer Processing LogicProcessing Logic
• I/O processingI/O processing• Business rulesBusiness rules• Data managementData management
Storage LogicStorage Logic• Data storage/retrievalData storage/retrieval
GUI Interface
Procedures, functions,programs
DBMS activities
44Chapter 9
Client/Server ArchitecturesClient/Server Architectures
File Server ArchitectureFile Server Architecture
Database Server Database Server
ArchitectureArchitecture
Three-tier ArchitectureThree-tier Architecture
Client does extensive processing
Client does little processing
55Chapter 9
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 processing.to 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
66Chapter 9
Figure 9-2 – File Server Architecture
FAT FAT CLIENTCLIENT
77Chapter 9
Database Server ArchitecturesDatabase Server Architectures 2-tiered approach2-tiered approach 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 and access Server performs all data storage and access processing processing DBMS is only on serverDBMS is only on server
AdvantagesAdvantages• Clients do not have to be as powerfulClients do not have to be as powerful• Greatly reduces data traffic on the networkGreatly reduces data traffic on the network• Improved data integrity since it is all processed centrallyImproved data integrity since it is all processed centrally• Stored proceduresStored procedures some business rules done on some business rules done on
serverserver
88Chapter 9
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
99Chapter 9
Figure 9-3 – Database server architecture
ThinneThinner r clientsclients
DBMS DBMS only on only on serverserver
1010Chapter 9
Three-Tier ArchitecturesThree-Tier Architectures
Three layers:Three layers:• ClientClient• Application serverApplication server• Database serverDatabase server
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
1111Chapter 9
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
1212Chapter 9
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 needsBetter match of systems to business needs Improved customer serviceImproved customer service Competitive advantageCompetitive advantage Reduced riskReduced risk
1313Chapter 9
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
1414Chapter 9
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• Improve performanceImprove performance• Improve interoperabilityImprove interoperability• Balanced workloadsBalanced workloads
1515Chapter 9
Processing Logic DistributionsProcessing Logic Distributions
2-tier distributions
n-tier distributions
Processing logic could be at client, server, or both
Processing logic will be at application server or Web server
1616Chapter 9
Parallel Computer ArchitecturesParallel Computer Architectures
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
1717Chapter 9
Parallel Computer ArchitecturesParallel Computer Architectures
Figure 9-6 –Tightly-coupled – CPUs share common memory space
Figure 9-7 –Loosely-coupled – CPUs each have their own memory space
1818Chapter 9
Query Processing with Query Processing with Parallel ProcessorsParallel Processors
Figure 9-5(a) –Parallel transactions
Figure 9-5(b) –Parallel query
1919Chapter 9
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
2020Chapter 9
Types of MiddlewareTypes of Middleware RPC – Remote Procedure Calls (RPC) RPC – Remote Procedure Calls (RPC)
• client makes calls to procedures running on remote client makes calls to procedures running on remote computerscomputers
• 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 server sends information to client when availableavailable
Object Request Broker (ORB)Object Request Broker (ORB)• Object-oriented management of communications between Object-oriented management of communications between
clients and serversclients and servers SQL-oriented Data AccessSQL-oriented Data Access
• Middleware between applications and database serversMiddleware between applications and database servers
2121Chapter 9
Database MiddlewareDatabase Middleware
ODBC – Open Database ODBC – Open Database ConnectivityConnectivity• Most DB vendors support thisMost DB vendors support this
OLE-DBOLE-DB• Microsoft enhancement of ODBCMicrosoft enhancement of ODBC
JDBC – Java Database ConnectivityJDBC – 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
2222Chapter 9
Web ServicesWeb Services XML – Extensible Markup Language, W3C XML – Extensible Markup Language, W3C
standard in 1998.standard in 1998. SOAP - Simple Object Access Protocol extensible SOAP - Simple Object Access Protocol extensible
framing mechanism for XML messages framing mechanism for XML messages UDDI - Universal Description, Discovery, and UDDI - Universal Description, Discovery, and
Integration (UDDI), defines a SOAP-based API for Integration (UDDI), defines a SOAP-based API for querying centralized Web Service repositories . querying centralized Web Service repositories .
WSDL -Web Services Description Language WSDL WSDL -Web Services Description Language WSDL is an XML format for describing network services is an XML format for describing network services as a set of endpoints operating on messages as a set of endpoints operating on messages containing either document-oriented or containing either document-oriented or procedure-oriented information procedure-oriented information
2323Chapter 9
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
2424Chapter 9
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 Good for ad hoc processing and
prototypingprototyping
2525Chapter 9
Figure 9-10: QBE view of a 2-table join query
Figure 9-12: Equivalent query in SQL