Upload
emilie
View
51
Download
2
Embed Size (px)
DESCRIPTION
Client/Server Distributed Systems. 240-322, Semester 1, 2005-2006. Objectives introduce the client/server model give an overview of DCE and Java RMI. 1. The Client Server Model (Chapters 1 and 2, Berson). Overview. 1.Client/Server Basics 2.Client/Server in More Detail - PowerPoint PPT Presentation
Citation preview
240-322 Cli/Serv.: Models/1 1
Client/Server Distributed SystemsClient/Server Distributed Systems
ObjectivesObjectives– introduce the client/server modelintroduce the client/server model– give an overview of DCE and Java RMIgive an overview of DCE and Java RMI
240-322, Semester 1, 2005-2006
1. The Client Server Model(Chapters 1 and 2, Berson)
240-322 Cli/Serv.: Models/1 2
OverviewOverview
1.1. Client/Server BasicsClient/Server Basics
2.2. Client/Server in More DetailClient/Server in More Detail
3.3. Client/Server SummaryClient/Server Summary
4.4. Standards OrganisationsStandards Organisations
5.5. DCEDCE
240-322 Cli/Serv.: Models/1 3
1. Client/Server Basics1. Client/Server Basics
A first examination of client/server A first examination of client/server functionality.functionality.
A brief definition:A brief definition:– A A serverserver is a program (or collection of is a program (or collection of
cooperating programs) that provides services cooperating programs) that provides services and/or manages resources on the behalf of other and/or manages resources on the behalf of other programs (its programs (its clientsclients).).
240-322 Cli/Serv.: Models/1 4
1.1. Client/Server Environment1.1. Client/Server Environment
LAN or WAN
Server DataBerson,Fig 1.4, p.8
clients
network
240-322 Cli/Serv.: Models/1 5
1.2. Example1.2. Example
The ATM network:The ATM network:– the clients are the ATM machines the clients are the ATM machines
user interfaces;user interfaces;some simple application processingsome simple application processing
– the server is at the bank the server is at the bank most application processing;most application processing;
very large database of customer accountsvery large database of customer accounts
240-322 Cli/Serv.: Models/1 6
1.3. Architectural Requirements1.3. Architectural Requirements
Reliable, robust communication between the clients Reliable, robust communication between the clients and server.and server.
Client/server cooperationClient/server cooperation– started by the clientstarted by the client
Application processing is usually distributed Application processing is usually distributed between a client and the server.between a client and the server.
Server Server controlscontrols services/data that the client accesses. services/data that the client accesses. Server handles conflicting requests.Server handles conflicting requests.
240-322 Cli/Serv.: Models/1 7
1.4. Recent Client/Servers Architectures1.4. Recent Client/Servers Architectures
More complex networkingMore complex networking– LAN, WAN LAN, WAN Web, InternetWeb, Internet– client mobilityclient mobility
More complex data structuresMore complex data structures– relational relational multimedia, OO, deductivemultimedia, OO, deductive– sizesize– distributed databasesdistributed databases– parallelismparallelism
continued
240-322 Cli/Serv.: Models/1 8
Separation of ‘business logic’ (i.e. program Separation of ‘business logic’ (i.e. program code for manipulating data) from the datacode for manipulating data) from the data– 3-tier (multi-tier) architectures3-tier (multi-tier) architectures– distributed business logicdistributed business logic
240-322 Cli/Serv.: Models/1 9
2. Client/Server in More Detail2. Client/Server in More Detail
2.1. Converting a Database App.2.1. Converting a Database App.
2.2. Component Placement?2.2. Component Placement?
2.3. The 2-tier Model2.3. The 2-tier Model
2.4. The 3-tier Model2.4. The 3-tier Model
2.5. Locating the Business Logic2.5. Locating the Business Logic
2.6. Locating the Data2.6. Locating the Data
2.7. Multi-tier Model2.7. Multi-tier Model
240-322 Cli/Serv.: Models/1 10
2.1. Converting a Database App.2.1. Converting a Database App.
Presentation Logic
Business Logic
Database Logic
DBMSDatabase
Stand-aloneApplication
240-322 Cli/Serv.: Models/1 11
Different client/server models are obtained by Different client/server models are obtained by locating different components and combinations locating different components and combinations of the application on the client and server(s).of the application on the client and server(s).
In general:In general:– presentation logic stays on the clientpresentation logic stays on the client– DBMS and database move to the serverDBMS and database move to the server
– parts of the business and database logic that can be used by parts of the business and database logic that can be used by several clients are placed on the serverseveral clients are placed on the server
240-322 Cli/Serv.: Models/1 12
2.2. Component Placement?2.2. Component Placement?
How much data is required by the local How much data is required by the local application?application?
How many application users require the same How many application users require the same data?data?
How many interactions occur between the How many interactions occur between the application parts?application parts?
Technical issuesTechnical issues– platforms, networking platforms, networking
240-322 Cli/Serv.: Models/1 13
2.3. The 2-tier Model2.3. The 2-tier Model Fig. 2.3, p.41 Fig. 2.3, p.41
Presentation Logic
Business Logic
Database LogicDBMS
Database
Database Logic
ClientServer
240-322 Cli/Serv.: Models/1 14
PointsPoints
The database is on the serverThe database is on the server– could some of it be moved to the client?could some of it be moved to the client?
Distributed database logicDistributed database logic– most of it is on the clientmost of it is on the client
The client does the presentation.The client does the presentation. ‘‘Fat’ versus ‘thin’ clients.Fat’ versus ‘thin’ clients. Much simpler if all the database servers are Much simpler if all the database servers are
the same (the same (homogenoushomogenous).).
240-322 Cli/Serv.: Models/1 15
DrawbacksDrawbacks
It is difficult to build It is difficult to build heterogeneousheterogeneous database database environments.environments.
Transaction processing is limited by the DBMS.Transaction processing is limited by the DBMS.
Asynchronous processing is difficultAsynchronous processing is difficult– i.e. the client doesn’t wait for the server’s answeri.e. the client doesn’t wait for the server’s answer
Scaleability?Scaleability?
240-322 Cli/Serv.: Models/1 16
2.4. The 3-tier Model2.4. The 3-tier Model Fig. 1.6, p.12 Fig. 1.6, p.12
ServerData
Application servers Data Servers
ServerData
UNIX
Win/NTClients
240-322 Cli/Serv.: Models/1 17
The 3-tier Model AgainThe 3-tier Model AgainFig.2.6, p.48Fig.2.6, p.48
Server
Mainframehost(s)
Tier 1
Tier 2
Tier 3
LAN
Price/PerformanceFunctionalityLocal Autonomy
Greater IntegritySecurityCentral Control
240-322 Cli/Serv.: Models/1 18
PointsPoints
The “Mainframe host” is usually a very The “Mainframe host” is usually a very large database (or databases)large database (or databases)– sometimes called a sometimes called a back-end serverback-end server
The “server” usually holds shared The “server” usually holds shared applications (application/business logic)applications (application/business logic)– sometimes called the sometimes called the middle-tier servermiddle-tier server
240-322 Cli/Serv.: Models/1 19
Benefits of 3-tier over 2-tierBenefits of 3-tier over 2-tier
The application logic in the middle-tier is more The application logic in the middle-tier is more independent of the client and the back-end serverindependent of the client and the back-end server– it should be more robustit should be more robust
The application logic in the middle-tier can work The application logic in the middle-tier can work more easily with data from multiple sources.more easily with data from multiple sources.
Encourages multiple back-end serversEncourages multiple back-end servers– encourages data distributionencourages data distribution
240-322 Cli/Serv.: Models/1 20
ProblemsProblems
Much more complex:Much more complex:– network management, data integrity, network management, data integrity,
maintenance, developmentmaintenance, development
Still (partially) dependent on platformsStill (partially) dependent on platforms– e.g. the client may still be restricted to a certain e.g. the client may still be restricted to a certain
application server, but not (maybe) to any data application server, but not (maybe) to any data serverserver
240-322 Cli/Serv.: Models/1 21
ExamplesExamples A ‘real’ ATM networkA ‘real’ ATM network
– the ATM machines are the clients (as before)the ATM machines are the clients (as before)
– the middle-tier servers provide certain processingthe middle-tier servers provide certain processing checking balances, money transfer requestschecking balances, money transfer requests directing queries to the relevant back-end serverdirecting queries to the relevant back-end server
– back-end server(s)back-end server(s) specialized by account typespecialized by account type very robust concurrency control, transaction processingvery robust concurrency control, transaction processing
continued
240-322 Cli/Serv.: Models/1 22
Many Web applications are 3-tier:Many Web applications are 3-tier:– the Web browser is the client softwarethe Web browser is the client software
– the embedded components in Web pages (e.g. the embedded components in Web pages (e.g. Java applets) come from the middle-tierJava applets) come from the middle-tier
– the back-end server contains the the back-end server contains the database/groupwaredatabase/groupware
240-322 Cli/Serv.: Models/1 23
2.5. Locating the Business Logic2.5. Locating the Business Logic Fig.2.12, p.60 Fig.2.12, p.60
Presentation Logic
Business LogicDBMS
Database
Database Logic
ClientServer
Business Logic
240-322 Cli/Serv.: Models/1 24
Three ways of distributing the ‘business Three ways of distributing the ‘business logic’ (i.e. the program code):logic’ (i.e. the program code):– locate it entirely on the client (‘fat’ client)locate it entirely on the client (‘fat’ client)– locate it entirely on the server (‘fat’ server)locate it entirely on the server (‘fat’ server)– split it between the client and serversplit it between the client and server
240-322 Cli/Serv.: Models/1 25
Fat Server AdvantagesFat Server Advantages
Easier to update the application logic since Easier to update the application logic since clients not involved.clients not involved.
Data is better hidden from clients.Data is better hidden from clients.
Easier to manage and debug since data and Easier to manage and debug since data and code is centrally located.code is centrally located.
Reduces bandwidth problems since data Reduces bandwidth problems since data processing stays on the server.processing stays on the server.
continued
240-322 Cli/Serv.: Models/1 26
Better for mission-critical applications Better for mission-critical applications when when fault-tolerance and stability are important.fault-tolerance and stability are important.
Encourages client simplicity and Encourages client simplicity and compatibility since the server must be able compatibility since the server must be able to work with many types of client.to work with many types of client.– e.g. serve Web pages e.g. serve Web pages without ActiveX ActiveX
240-322 Cli/Serv.: Models/1 27
Fat Client AdvantagesFat Client Advantages
The server is unaffected when updates The server is unaffected when updates are done to the client’s application logicare done to the client’s application logic– the server will be more stablethe server will be more stable
Easier to programEasier to program– less networkingless networking– more direct access to client platform more direct access to client platform
features, such as GUIfeatures, such as GUI
240-322 Cli/Serv.: Models/1 28
Database
2.6. Locating the Data 2.6. Locating the Data Fig.2.14,p.69Fig.2.14,p.69
Presentation Logic
Business LogicDBMS
Database
Database LogicClient
Multiple Servers
DBMS
Database Logic
Database
240-322 Cli/Serv.: Models/1 29
IssuesIssues
Dividing up the data.Dividing up the data.
Transparency of the distribution.Transparency of the distribution.
Data integrity / synchronisation / Data integrity / synchronisation / consistency.consistency.
Data administration / management.Data administration / management.
240-322 Cli/Serv.: Models/1 30
Transaction ProcessingTransaction Processing
A transaction is a sequence of actions which A transaction is a sequence of actions which takes a system (usually a database) from takes a system (usually a database) from one consistent state to another.one consistent state to another.– e.g. change a customer’s recorde.g. change a customer’s record
A transaction should possess the “A transaction should possess the “ACIDACID” ” properties:properties:– AAtomicity, tomicity, CConsistency, onsistency, IIsolation, solation, DDurabilityurability
continued
240-322 Cli/Serv.: Models/1 31
Recovery and concurrency mechanisms are Recovery and concurrency mechanisms are necessary, typically implemented in a necessary, typically implemented in a Transaction Processing Management (TPM) Transaction Processing Management (TPM) system.system.
TPMs become very complex when data is TPMs become very complex when data is distributed.distributed.– ACID must be distributed as wellACID must be distributed as well
240-322 Cli/Serv.: Models/1 32
2.7. Multi-tier Model 2.7. Multi-tier Model Fig.2.9,p.53Fig.2.9,p.53
Middleware
Physical Network
240-322 Cli/Serv.: Models/1 33
Common New FeaturesCommon New Features
Asynchronous connectivityAsynchronous connectivity– e.g. asynchronous RPCse.g. asynchronous RPCs
Data distribution using replicationData distribution using replication
Name/directory services for resource location Name/directory services for resource location independenceindependence
More complex data typesMore complex data typescontinued
240-322 Cli/Serv.: Models/1 34
More complex analysisMore complex analysis– e.g. data mining, network characteristicse.g. data mining, network characteristics
Authentication servicesAuthentication services– you must 'prove' who you are to the systemyou must 'prove' who you are to the system
Distributed file system(s)Distributed file system(s)
Time servicesTime services
240-322 Cli/Serv.: Models/1 35
ExamplesExamples
Domain-specific:Domain-specific:– ODBC, SQL, Oracle GlueODBC, SQL, Oracle Glue
Groupware middleware:Groupware middleware:– Microsoft Exchange, Lotus NotesMicrosoft Exchange, Lotus Notes
Object middleware:Object middleware:– CORBA, DCOM (more on these in part 2)CORBA, DCOM (more on these in part 2)
240-322 Cli/Serv.: Models/1 36
Mult-tier Web ApplicationsMult-tier Web Applications
The Web browser is the client software on the The Web browser is the client software on the first tier.first tier.
Web page components come from the second Web page components come from the second tier.tier.
The third tier is a database front-end for a series The third tier is a database front-end for a series of fourth tier heterogeneous databasesof fourth tier heterogeneous databases– the third tier database may have been constructed the third tier database may have been constructed
with data mining techniqueswith data mining techniques
240-322 Cli/Serv.: Models/1 37
3. Client/Server Summary3. Client/Server Summary
3.1. Recurring Issues3.1. Recurring Issues
3.2. Advantages of Client/Server3.2. Advantages of Client/Server
3.3. Disadvantages of Client/Server3.3. Disadvantages of Client/Server
240-322 Cli/Serv.: Models/1 38
3.1. Recurring Issues3.1. Recurring Issues
LAN, WAN, Internet scalingLAN, WAN, Internet scaling Data distribution/replicationData distribution/replication Distributed processingDistributed processing System management/maintenanceSystem management/maintenance Choice of middlewareChoice of middleware Standards / open systemsStandards / open systems
240-322 Cli/Serv.: Models/1 39
What’s an Open System?What’s an Open System?
An open system:An open system:– complies with industry standards for complies with industry standards for
programming, communication, networking, programming, communication, networking, presentation, etc.presentation, etc.
– is designed with portability/interoperability in is designed with portability/interoperability in mindmind
– is scaleableis scaleable
240-322 Cli/Serv.: Models/1 40
3.2. Advantages of Client/Server3.2. Advantages of Client/Server
Mainframe functionality can be made widely Mainframe functionality can be made widely availableavailable– cost benefitscost benefits
Processing and data are localised on the serverProcessing and data are localised on the server– reduces network traffic, response time,reduces network traffic, response time,
bandwidth requirementsbandwidth requirements
Business logic can be distributed (in 3-tier model)Business logic can be distributed (in 3-tier model)– reuse, portabilityreuse, portability
continued
240-322 Cli/Serv.: Models/1 41
Encourages open systemsEncourages open systems
Present-day systems are too large and Present-day systems are too large and involve too many users to be located on one involve too many users to be located on one machine.machine.
240-322 Cli/Serv.: Models/1 42
3.3. Disadvantages of Client/Server3.3. Disadvantages of Client/Server
The server becomes a bottleneckThe server becomes a bottleneck
Distributed applications are much more complex Distributed applications are much more complex than non-distributed onesthan non-distributed ones– i.e. in development, run time, maintenance, upgradesi.e. in development, run time, maintenance, upgrades
Requires a shift in business practisesRequires a shift in business practises– local, simple data local, simple data distributed, open, complex datadistributed, open, complex data
240-322 Cli/Serv.: Models/1 43
4. Standards Organizations4. Standards Organizations
POSIXPOSIX: Portable Operating Systems Interface: Portable Operating Systems Interface– family of standards developed by IEEEfamily of standards developed by IEEE
– POSIX working groups have standardised C, UNIX POSIX working groups have standardised C, UNIX shell, networking API for sockets, real-time, threads, shell, networking API for sockets, real-time, threads, etc.etc.
continued
240-322 Cli/Serv.: Models/1 44
The The Open GroupOpen Group– consolidation of X/Open company and Open consolidation of X/Open company and Open
Software Foundation (OSF)Software Foundation (OSF)
– consortium of vendors and consortium of vendors and industrial/government usersindustrial/government users
– developed API for UNIX, including XTI developed API for UNIX, including XTI (X/Open Transport Interface) network protocol(X/Open Transport Interface) network protocol
continued
240-322 Cli/Serv.: Models/1 45
Internet Engineering Task Force (Internet Engineering Task Force (IETFIETF))– community of network designers, operators, community of network designers, operators,
vendors, and researchersvendors, and researchers– concerned with the evolution of the Internet concerned with the evolution of the Internet
architecturearchitecture– e.g. sockets API for IP version 6 (IPv6)e.g. sockets API for IP version 6 (IPv6)
128-bit addresses, simpler header, multicasting, 128-bit addresses, simpler header, multicasting, authentication and securityauthentication and security
continued
240-322 Cli/Serv.: Models/1 46
ISOISO (International Organization for Standards) (International Organization for Standards)– main standards organizationmain standards organization– e.g. communications protocol: the Open Systems e.g. communications protocol: the Open Systems
Interconnection (OSI) reference modelInterconnection (OSI) reference model
OMGOMG (Object Management Group) (Object Management Group)– object-oriented standardsobject-oriented standards– e.g. CORBAe.g. CORBA
240-322 Cli/Serv.: Models/1 47
5. DCE5. DCE
The Distributed Computing EnvironmentThe Distributed Computing Environment– developed by the OSF (late 1980’s)developed by the OSF (late 1980’s)– openopen– very extensive features (and complex)very extensive features (and complex)
Basic programming feature is the Remote Basic programming feature is the Remote Procedure Call (Procedure Call (RPCRPC))– other features: name/directory services, other features: name/directory services,
authentication, security, data pipesauthentication, security, data pipes
240-322 Cli/Serv.: Models/1 48
DCE RPCDCE RPC
ClientApplicationcode
RPC
Stub Code
RPC runtime library
Server
Network
Input Output
Applicationcode
RemoteProcedure
Stub Code
RPC runtime library
240-322 Cli/Serv.: Models/1 49
Using RPCUsing RPC
The data structures to be passed as arguments of The data structures to be passed as arguments of the RPC call are used by a compiler to generate the RPC call are used by a compiler to generate the client and server stub code.the client and server stub code.
The data structures are written in a special high-The data structures are written in a special high-level language (simplified C types), which are level language (simplified C types), which are easily converted to network packets.easily converted to network packets.
240-322 Cli/Serv.: Models/1 50
DCE Client/Server Model (v.2)DCE Client/Server Model (v.2)
DistributedDCE Application
Executive
OS and NetworkInterface
DistributedDCE Application
Services Data Sharing
OS and NetworkInterface
Client Server
Network
Fig 1.10, p.27
240-322 Cli/Serv.: Models/1 51
DCE ArchitectureDCE ArchitectureApplications
PC Integration Dist. Services
MgmtSecurity DFS: Dist. File Services
Naming Services
Time Services
Future CoreServices
RPCs
Presentation Services
Threads Services
OS
Network Services
Fig. 1.9, p.23
240-322 Cli/Serv.: Models/1 52
5.1. Distributed File System (DFS)5.1. Distributed File System (DFS)
Problem: how to allow a user on one system to Problem: how to allow a user on one system to modify data stored on a file in another system?modify data stored on a file in another system?– User = clientUser = client– Distant data is managed by a file serverDistant data is managed by a file server
240-322 Cli/Serv.: Models/1 53
IssuesIssues
Access security and protectionAccess security and protection– user authentication (Kerberos) + user controluser authentication (Kerberos) + user control
Data reliabilityData reliability Data availabilityData availability PerformancePerformance ManagementManagement
240-322 Cli/Serv.: Models/1 54
5.3. More Details5.3. More Details
There are several books from O’Reilly on different There are several books from O’Reilly on different aspects of DCE:aspects of DCE:– "Understanding DCE""Understanding DCE"
– "Guide to Writing DCE Applications""Guide to Writing DCE Applications"
– "Distributed Applications Across DCE "Distributed Applications Across DCE and Windows NT"and Windows NT"
– "Introduction to OSF DCE""Introduction to OSF DCE" (in PSU library)(in PSU library)
We will look at simple RPC on UNIX later in the We will look at simple RPC on UNIX later in the course.course.