Distributed Computing
Distributed Computing
and Java™
Sang Shin
Java™ Technology Evangelist
[email protected]
Topics
2
Objectives
3
Overview of
Distributed Computing
(Network Computing)
Virtual Fish Tank
Organization
Waves of Embedded
Things - 1014
Computers
Network Computing 1011 Thermostats
Cars
Switches
Computers TVs
Packages
108
Phone
s Games Clothes
Desktops
Clients
Functions Transfers Transactions Content Telemetry
Control IP v4 IP Layer IP v6
Protocols FT SMTP
T
Pelnet RPC/XDR
X RMI/IIOP
LDAP SOAP Identity
Organization HTTP
Client/Server Jini
UDDI JXTA
N-tier Web Applications
Web Polyarchical
Services
Fractal
Platform Evolution
The Network The Computer Network of
Catch Is the Legacy to Is the Embedded Network
Phrase Computer Objects the Web Network Things of Things
Schematic
Design Patterns
Client- Web Web Hybrid
Server 3-Tier Application Services P2P Fractal
Three Laws of Computing
Moore's Law
Computing power doubles every 18
months
Gilder's Law
Network bandwidth capacity doubles
every 12 months
Metcalfe's Law (Net Effect)
Value of network increases
exponentially as number of
participants increases
10
Current Enterprise Reality
Video
Web Server Solaris™
Telco Server
Server Workstation
Pager
Public Firewall
Corporate
Internet Internet
Thin Client
Cell Phone
NT
Thin Client Solaris Workstation
Workgroup
Workstation Server
PDA
11
What is a distributed system?
A collection of processes/processors
that do not share memory or a clock
12
Why Distributed Systems?
Resource sharing
Higher performance
Flexible
Reliable
Scalable
Cheaper
Manage’able (it depends)
13
Characteristics of Distributed
Systems
Complex programming
Heterogeneous
Hardware, OS, networking behavior,
object model, programming language
Inherent problems
Network latency
Concurrency issues
Partial Failure
14
7 Fallacies of Distributed
Computing
The network is reliable
Latency is zero
Bandwidth is infinite
The network is secure
Topology doesn't change
There is one administrator
Transport cost is zero
15
Terminology
16
Distributed Coordination
Mutual Exclusion
Atomicity
Concurrency Control
Deadlock Handling
Election Algorithms
Transaction
2 phase commit
17
Distributed Systems
Evolution
18
Early Distributed Systems
RPC
DCE, ONC
Distributed File Systems
example - NFS, SMB
Databases
example - Oracle
Transaction Processing Monitors
example - CICS
19
At the root of it all ...
Sockets
Socket, ServerSocket, SocketImpl classes
Uses
Data compression
multicast
custom protocols, etc.
20
JDBC
What is JDBC?
22
JDBC Architecture
JDBC API
JDBC Driver Manager
SPI
Bridge Sybase DB2 Oracle
ODBC driver driver driver
23
A 2-tier Example
JDBC
Front
end Database
Front
end
Front Database
end
24
JDBC Status
25
JDBC Resources
Java Packages
java.sql
javax.sql
Websites
java.sun.com/products/jdbc
Books
DatabaseProgramming with JDBC and
Java by George E. Reese, George H.
Reese
26
RMI
(Remote Method Invocation)
What is RMI?
RMI JDBC
Front
end Database
Front Database
end
29
RPC Architecture (General)
30
RMI Architecture
Java Java
Client Server
JRMP
Stub Skeleton
31
Class Loading
Lookup
Server
Client
32
Object Serialization
33
RMI Development Process
34
RMI Deployment
rmiregistry
Provides a bootstrap service to locate the
first server object
Start the server
Start the client
35
RMI Status
36
Customer Feedback
37
Customer Feedback (Cont’d)
38
RMI over IIOP
39
RMI over IIOP
40
RMI over IIOP (Simplified)
Java Any
Client Server
ORB IIOP ORB
41
RMI over IIOP Features
Java IDL
Uses OMG's Java Language Mapping
Layered on Internet Inter ORB Protocol
(IIOP)
Generates Portable Stubs/Skeletons
43
Java IDL Development
44
Java IDL runtime
45
XML
What Is XML?
47
XML and Java Technology
Complementary technologies
XML is portable reusable data
Java Technology is portable behavior
48
What is Needed?
49
XML Schema
XML schema
50
J2EE
What Is the Java™ 2 Platform,
Enterprise Edition (J2EE)?
Open and standard based platform
for
developing, deploying and managing
n-tier, Web-enabled, server-centric
enterprise applications
52
The Java™ 2 Platform
53
What Do You Get from J2EE?
54
J2EE 1.3APIs and Technologies
Version
Java 2 SDK, Standard Edition 1.3
RMI/ IIOP 1.0
JDBC™ 3.0
Java Messaging Service 1.0.2b
JNDI 1.2.1
Servlet 2.3
JavaServer Pages™ 1.2
JavaMail 1.2
JavaBeans™ Activation Framework 1.0.1
Enterprise JavaBeans 2.0
Java Transaction API 1.0.1
Java Transaction Service 1.1
Connector Architecture 1.0
ECPerf™ 1.0
55
What is EJB Technology?
Cornerstone of J2EE
A server-side component technology
Easy development and deployment of
Java technology-based application
that are:
Transactional,distributed, multi-tier,
portable, scalable, secure, …
56
Why EJB Technology?
58
What is a Servlet?
59
Servlets vs. CGI
Request CGI1
Child for CGI1
Request Servlet1
Servlet Based Webserver
60
Code for a Simple Servlet
61
What is JSP Technology?
62
Big Picture
HTML/XML
HTTP(S)
Client
63
Servlets and JSP - Comparison
Servlets JSP
HTML code in Java-like code in
Java HTML
Any form of Data Structured Text
Not easy to author Very easy to author
Underlying Code is compiled
semantics into a servlet
64
JTS/JTA (Transaction
Processing)
Distributed transaction processing
JTS: Mapping to CORBA Object
Transaction Service (OTS)
Access to standard object transaction
coordination
Who: IBM, Inprise, Bull, WebLogic
65
•JNDI (Naming and Directory)
66
JMS (Messaging and Pub/Sub)
67
Java 2 Platform,
Enterprise Edition
API and Technology specifications
Development and Deployment
Platform
Reference implementation
Compatibility tests with branding
J2EE BluePrints
68
Platform Value to Developers
Unified platform
Choice of platform implementation
Performance
Scalability
Reliability
Manageability
Tools
Increased productivity
Portability of code
Ready-to-use security framework 69
J2EE is End-to-End Solution
Firewall J2EE
Application
Client Server
Enterprise
Enterprise Information
JavaBeans™
Client Systems (EIS):
Client Relational
Database,
Web Enterprise Legacy
Client Server JavaBeans Applications,
JSP, ERP Systems
Servlets
Client
HTML/XML
Other Services:
JNDI, JMS, Enterprise
Client Middle JavaMail™ Information
Tier Tier Tier
70
J2EE Containers & Components
Applet HTTP/
HTTPS JSP Servlet RMI EJB
J2SE
RMI/IIOP
RMI/IIOP
JavaMail JavaMail
JDBC
JDBC
JMS
JTA
JNDI
JMS
JTA
JNDI
App Client JAF JAF
Container
App
Client
HTTP/
HTTPS J2SE
RMI
RMI/IIOP
JDBC
JNDI
JMS
J2SE J2SE
Database
71
Containers and Components
Containers Components
Handle Handle
Concurrency Presentation
Security Business Logic
Availability
Scalability
Persistence
Transaction
Lifecycle
management
Management
72
Lifecycle illustration
Creation Assembly Deployment
Created by Assembled
J2EE Modules and Augmented J2EE APP Processed
Component by Application by Deployer
Developer Assembler
Deploy
J2EE Container
Enterprise
Components
73
Java 2 Platform,
Enterprise Edition
API and Technology specifications
Development and Deployment
Platform
Reference implementation
Compatibility Test Suite (CTS)
J2EE BluePrints
74
What and Why a Reference
Implementation?
Validates specification
Fully-compliant
Fully-functional
Not commercial quality
Scalability
Performance
75
Compatibility Test Suite (CTS)
76
J2EE BluePrints
Sample code
Java Pet Store
77
Summary
78