TS-2614 - Jini™ Network Technology-Enabled Service-Oriented Architecture, A Low-Cost Alternative...
-
Upload
steve-hoffman -
Category
Technology
-
view
292 -
download
4
description
Transcript of TS-2614 - Jini™ Network Technology-Enabled Service-Oriented Architecture, A Low-Cost Alternative...
java.sun.com/javaone/sf
| 2004 JavaOneSM Conference | Session TS-26141
Jini™ NetworkTechnology-EnabledService-OrientedArchitecture
Leon Chism/Steve HoffmanChief Internet Architect/Engineering FellowOrbitzwww.orbitz.com
A Low-Cost Alternative toEnterprise JavaBeans™ (EJB™)Architecture
| 2004 JavaOneSM Conference | Session TS-26142
Goal
Increase your understanding of Jini™network technology distributed computingarchitectures, how they can facilitatecompetitive advantage, and how they canbe used to replace/augment moreexpensive alternatives.
| 2004 JavaOneSM Conference | Session TS-26143
Orbitz’s Commitment toJini™ Network TechnologyOr why am I listening to you?• Orbitz runs over 1300 Jini™ services used by
over 300 client VMs• Orbitz’ Jini™ network technology-based
architecture powers Orbitz.com, AA.com andNWA.com, making it one of the highest-volumeprocessors of airline tickets
• Jini™ services have achieved 99+% uptime(best uptime of all sub-systems at Orbitz)
| 2004 JavaOneSM Conference | Session TS-26144
Agenda
IntroductionOrbitz ArchitectureJini™ Technology BenefitsDistributed Computing PitfallsWhat’s Next?Wrap up
| 2004 JavaOneSM Conference | Session TS-26145
Agenda
IntroductionOrbitz ArchitectureJini™ Technology BenefitsDistributed Computing PitfallsWhat’s Next?Wrap up
| 2004 JavaOneSM Conference | Session TS-26146
Orbitz Overview
• Founded in 2000 by 5 leading airlines• Site launched in 2001• Top 3 brand travel site in just over two years• 22 MM registered users and strong
monthly traffic• Poised to extend
strength in air toother products
• Positive cash flowfrom operationssince Q4 2002
• Public offeringon 12/17/03
| 2004 JavaOneSM Conference | Session TS-26147
2001
Orbitz8%
Expedia31%
Other28%
Travelocity33%
Rapidly Approaching #2 PositionBased on gross travel bookings
Source: PhoCusWright
Jan 1–Jun 30 2003
Orbitz17%
Expedia40%
Other23%
Travelocity20%
| 2004 JavaOneSM Conference | Session TS-26148
Architectural Drivers
• Low-cost distributor• Speed to market is critical• Flexibility of the application• Robustness─Availability─Reliability
| 2004 JavaOneSM Conference | Session TS-26149
Why Use Jini™ Network Technology?
• Enables automatic failover and recovery• Scales horizontally• Lookup capabilities─Typed─Interface-based
• Functionality didn’t require transactions• Automatic load balancing• Self-healing• Low-cost (no license costs)
| 2004 JavaOneSM Conference | Session TS-261410
Agenda
IntroductionOrbitz ArchitectureJini™ Technology BenefitsDistributed Computing PitfallsWhat’s Next?Wrap up
| 2004 JavaOneSM Conference | Session TS-261411
Orbitz ArchitectureMile-high view
Presentation /State / Persistence
Webapp
Web Services
IVR / Messaging
Apache
Weblogic
Oracle
GenericServices
Air Services
Hotel Services
Car Services
Supplier—Specific Services
GDS X Service
Airline X Service
Airline Y Service
GDS Y ServiceHotel Switch X Service
Hotel Switch Y Service
Jini wrappersaround legacy
systems andinternally hosted
J2EE systems
| 2004 JavaOneSM Conference | Session TS-261412
Supplier LinkSingle host system (i.e. AA.com/NWA.com)
| 2004 JavaOneSM Conference | Session TS-261413
SLONEGOrbitz.com
WebLogicApp Server
ONEGServer
LoggingService
Wspan
AA
CO
NW
HP
US
Pegs
TWeb
Discover Publish Publish
Log Log Log
Discover
ONeG—The Big SwitchPutting it all together
LUSLUS
LUS
LoggingService
LUSLUS
LUSLUS
LoggingService
LoggingService
LoggingService
LoggingService
Log
WebLogicApp Server
WebLogicApp Server
WebLogicApp Server
WebLogicApp Server
WebLogicApp Server
Hotel-OnegServer
OtherServicesOther
ServicesOther
Services
ONEGServer
ONEGServer
ONEGServer
| 2004 JavaOneSM Conference | Session TS-261414
ONeG—Design Decisions
• Client could have contacted host specificservices directly
• Was decided to put failure/retry logic inthe booking engine, not push on the clientdue to hot reconfiguration requirements
• Business event logging at ONeG layer• Use network layer security to restrict
access to supplier specific layer
Switch or router?
| 2004 JavaOneSM Conference | Session TS-261415
High-Level Architecture Diagram
Novo System(incl. orbitz.com
AAHostingSystem
(connects only toSabre AA)
aa.com
OrbitzSupplier
LinkSystem
nw a.com
Jini
SL
Ser
vice
s i/f
Jini
SL
Ser
vice
s i/f
NWHostingSystem
(connects only toWorldSpan)
Jini
SL
Ser
vice
s i/f
ONeG / Hotel(Rate request,
content,search)
Jini
SL
Ser
vice
s i/f
Kinetics
SharesCOHP
1PWorldSpan(NW)
Bookings DB
SiteDB
OrbitzMerchant
Hotels(OMH)
Pegasus(external)
Jini
SL
Ser
vice
s i/f
SabreAAUS
Not
ifica
tion
Jini
i/f
Kin
etic
sS
ervl
et i
/f
SMTPService
Not shownReportingMonitoring/mgt/adminCustomer CareOther agent desktop usageGatew ayPartnersAdvertising
Represents request/response where therequest is made in the indicated direction
ITA
ClearCommerce
RPS
ONeG(Air, Car,
HotelBookings)
IVRService
"Pub
lic"
HTT
P i/
fFulf illmentServ let i/f
HotelReference
Hotel DB(Rate Cache)
Inte
rnet
SmartProxy
Jini surrogate
Notif ica-tion
Serv er
Web-site Front-ends Supplier System "Third-parties"
OAG
Flifo
Ser
vlet
i/f
Flif oServ er
Flif oJini i/f
J2EE
Jini
| 2004 JavaOneSM Conference | Session TS-261416
The General Idea
Combine common set of objects, serviceinterfaces and JiniSM services to createblocks of reusable functionality.
| 2004 JavaOneSM Conference | Session TS-261417
The General Idea (Cont.)
• Common objects─AIRPORT─CARRIER
• Service interfaces─LowFareSearchRequest─AirPurchaseRequest
• Mask framework details with simple Factory─ServiceImpl =OrbitzFactory.get(serviceInterface);
• Simple configuration (at least for client)─VersionAttribute String─List of lookup servers OR list of multicast groups
| 2004 JavaOneSM Conference | Session TS-261418
The General Idea (Cont.)
• Response (and objects contained) arecore objects or interfaces are immutable
• Underlying implementations typically havemuch more information than is exposedto client
• Services are all transient and non-activatablehence completely interchangeable
• No transactions
Things to note:
| 2004 JavaOneSM Conference | Session TS-261419
Let’s See Some Code!
• StartupClientStarter.start();
• ShutdownClientStarter.stop();
• Sample transactionSampleServiceRequest req =
OrbitzFactory.get(SampleServiceRequest.class);
req.setFoo(foo);
req.setBar(bar);
SampleServiceResponse resp = req.execute();
baz = resp.getBaz();
Client’s perspective:
| 2004 JavaOneSM Conference | Session TS-261420
Say What? Show Me a Picture….req = OrbitzFactory.get(FooRequest);
req.setXXX(xxx); ObjectFactoryJini Service
http codebaseserver
FooRequestImpl
resp = req.execute();
resp.getYYY();
remote = OrbitzFactory.get(FooRemote);return remote.execute(req);
FooRemoteJini Service
FooResponseImpl
| 2004 JavaOneSM Conference | Session TS-261421
Let’s See More Code!
• StartupServerStarter.start();
SampleService ss = new SampleServiceImpl();// SampleServiceImpl extends UnicastRemoteObject// Need to run rmic to generate _Stub class
DiscoveryManagment ldm =ServerStarter.getDiscoveryManager();// Most likely LookupDiscoveryManager
JoinManager jm = new JoinManager(ss, attributes,null, ldm, null);// attributes is an Entry[] which includes// things like VersionAttribute
Publishing a Service (Jini 1.X)
| 2004 JavaOneSM Conference | Session TS-261422
Let’s See More Code!
• ShutdownUnicastRemoteObject.unexport(ss, false);
jm.terminate();
ServerStarter.stop();
Publishing a Service (Jini 1.X) (cont.)
| 2004 JavaOneSM Conference | Session TS-261423
Agenda
IntroductionOrbitz ArchitectureJini™ Technology BenefitsDistributed Computing PitfallsWhat’s Next?Wrap up
| 2004 JavaOneSM Conference | Session TS-261424
Jini™ Technology Benefits
• Designed to expect network failure(not ignore that it happens)
• Multicast discovery mechanism ofLookup Server ensures <1 minutediscovery (heartbeat)
• Services come and go. Have manyplaces to go to get serviced
Self-healing
| 2004 JavaOneSM Conference | Session TS-261425
Jini™ Technology Benefits
• LookupCache andServiceDiscoveryManager use randomselection when single service is requestedand there are multiple matches
• Over time this results in an even loaddistribution of load on identical services
Automatic load balancing
| 2004 JavaOneSM Conference | Session TS-261426
Jini™ Technology Benefits
• Capacity is directly related to the number ofplaces a client can go to fulfil a service request
• If you need more capacity of a particularservice, just start more instances
• Each LookupCache gets notified of newservice and load is redistributed acrossnew set
Horizontal scalability
| 2004 JavaOneSM Conference | Session TS-261427
Jini™ Technology Benefits
• Easy to publish a service• Easy to find a service• Catch RemoteException and discard
proxy when something goes wrong
Lightweight
| 2004 JavaOneSM Conference | Session TS-261428
Agenda
IntroductionOrbitz ArchitectureJini™ Technology BenefitsDistributed Computing PitfallsWhat’s Next?Wrap up
| 2004 JavaOneSM Conference | Session TS-261429
Distributed Computing Pitfalls
• We don’t use remote objects• No way to turn it off in JRMP
implementation of RMI (Jini versions 1.X)• Default 1 minute DGC interval kills any
heap optimizations• Accounts for anywhere between 50-75%
of the threads in our system
RMI Distributed Garbage Collection
| 2004 JavaOneSM Conference | Session TS-261430
Distributed Computing Pitfalls
• Make DGC interval longer or disableexplicit GC (we saw a 1.5% improvementin VM throughput when using-XX:+DisableExplicitGC—time spent running code vs doing GC)
• Upgrade to Jini 2.X and use JERI sowe can disable DGC
RMI DGC—possible remedies
| 2004 JavaOneSM Conference | Session TS-261431
Distributed Computing Pitfalls
• Contributed implementation designed to waituntil things aren’t changing before answering
• Implemented with big reader’s/writer lock• Not common, but annoying when
LookupCache/ServiceDiscoveryManager dropsall discovered services when leaseto lookup server cannot be renewed
Reggie lockouts
| 2004 JavaOneSM Conference | Session TS-261432
Distributed Computing Pitfalls
• Longer lease times• Custom implementation of lookup server that
doesn’t have reader’s/writer lock. Won’t getbest picture of state of services, but isn’tnecessary in our system
Reggie lockouts—possible remedies
| 2004 JavaOneSM Conference | Session TS-261433
Distributed Computing Pitfalls
• If a machine gets slow, random selection willeventually put all requests on the slow machine
• Also a problem in heterogeneous environments
Randomized load balancing
| 2004 JavaOneSM Conference | Session TS-261434
Distributed Computing Pitfalls
• Switch from sync. calls to async so apush to a service becomes a pull.Use a JavaSpaces™ or JMS™ queue
• Publish Attribute with notion of relativecapacity in conjunction withServiceItemFilter on client side toadjust spread of service calls more in-linewith machine’s relative abilities
Randomized load balancing—possible remedies
| 2004 JavaOneSM Conference | Session TS-261435
Distributed Computing Pitfalls
• LookupCache uses event notification tokeep local VM cache up to date
• If large number of clients/lookupservers/services, the math gets big—e.g.:─100 app servers (service clients) * 2 lookup servers
* 30 services/VM * 20 VMs = 120,000 messages
• Contributed implementation of Lookup Serverdoes in-order delivery of notifications whichinvolves a linear scan of a single list ofmessages to send out
Event storming using the LookupCache
| 2004 JavaOneSM Conference | Session TS-261436
Distributed Computing Pitfalls
• Custom LookupCache that doesn’t useevent notifications:─Every client probably doesn’t need more than 3-4
places to go for a particular service type at any time─Auto-expire entries based on time or number of
calls to get same randomization─Backfill with more services as current ones
become invalid
• Custom Lookup Server with event moduleoptimized for throughput of in-order eventnotification
Event storming—remedies
| 2004 JavaOneSM Conference | Session TS-261437
Distributed Computing Pitfalls
• Coarser grained services─Group services living in single VM
(usually due to resource sharing i.e. DB pool)into single (or fewer) Jini™ service(s).Fewer event notifications to be sent
• Partitioning of service registrations─Group service registrations to reduce the
number of messages sent by a singleinstance of the Lookup Server
Event storming—remedies (cont.)
| 2004 JavaOneSM Conference | Session TS-261438
Jini™ and J2EE™
• Have Jini environment, but want tointroduce some J2EE™ servers(or vice-versa). What do you do?
• Deploy webapp that publishes Jini™service interface similar to EJB™ interface,but service impl makes EJB local call
• Jini service lookups take the place ofJNDI lookups─Multiple copies give same result as
clustered directory service─Can live side-by-side with other APIs:
XML/SOAP, JNDI EJB lookup, etc.
Two great tastes that go great together
| 2004 JavaOneSM Conference | Session TS-261439
Agenda
IntroductionOrbitz ArchitectureJini™ Technology BenefitsDistributed Computing PitfallsWhat’s Next?Wrap up
| 2004 JavaOneSM Conference | Session TS-261440
What’s Next?
• JERI─Disable distributed garbage collection─Plugable transports (UDP, SSL)
• Security (per service)─Authorization─Authentication─Replace 2 layers of Jini services with 1
now that we can isolate/restrict accessto services individually
Jini 2.X upgrade
| 2004 JavaOneSM Conference | Session TS-261441
Let’s See More Code!
• StartupServerStarter.start();
SampleService ss = new SampleServiceImpl();// SampleServiceImpl implements Remote
Exporter e = new BasicJeriExporter(TCPServerEndpoint.getInstance(0),new BasicILFactory());
Remote stub = e.export(ss);
DiscoveryManagment ldm =ServerStarter.getDiscoveryManager();
JoinManager jm = new JoinManager(stub, attributes,null, ldm, null);
Publishing a Service (Jini 2.X)
| 2004 JavaOneSM Conference | Session TS-261442
Let’s See More Code! (Cont.)
• Shutdowne.unexport(stub);
jm.terminate();
ServerStarter.stop();
Publishing a Service (Jini 2.X)
| 2004 JavaOneSM Conference | Session TS-261443
What’s Next? (Cont.)
• If Jini services use downloaded code,why can’t all the code be downloadable?
• Introduce standard deployment platformutilizing benefits of transportable byte-code─Reconfigure capacity as needed─Ease deployment across many machines
• Interesting work along these lines:─Rio—http://rio.jini.org/─Jini Service Container—http://chiron.jini.org/
Dynamic redeployment
| 2004 JavaOneSM Conference | Session TS-261444
What’s Next? (Cont.)
• Perhaps change from sync-client-pushto async-server-pull model─Using JavaSpaces™─Using JMS™ queue
• Would keep servers from gettingoverloaded since they wouldn’t pullmore work than they could handle
• Could have a more heterogeneousenvironment of hardware whilemaximizing utilization
• Downside is introducing a single pointof failure if the space/queue isn’t reallyfault-tolerant
Asynchronous messaging
| 2004 JavaOneSM Conference | Session TS-261445
Agenda
IntroductionOrbitz ArchitectureJini™ Technology BenefitsDistributed Computing PitfallsWhat’s Next?Wrap up
| 2004 JavaOneSM Conference | Session TS-261446
Summary
• Try Jini™ services its:─A great way for distributed applications to
discover and communicate with each other─Lightweight, flexible, adaptable, self-healing─Production ready─The best kept secret in the Java™ community
program
• J2EE™ platform is not the solution forevery problem
| 2004 JavaOneSM Conference | Session TS-261447
For More Information
• http://www.orbitz.com/• http://www.jini.org/─Strong and helpful community group. Presentations
from 7th community meeting are online for free─Mailing list/archives─Download Jini 2.0
• http://research.sun.com/techrep/1994/abstract-29.html (A Note On Distributed Computing)
• Core Jini, W. Keith Edwards─ISBN: 0130894087 (Jini 1.X)
• Hard Landing, Thomas Petzinger Jr.─ISBN: 0812928350 (Airline lore)
| 2004 JavaOneSM Conference | Session TS-261448
Q&A
48
java.sun.com/javaone/sf
| 2004 JavaOneSM Conference | Session TS-261449
Jini™ NetworkTechnology-EnabledService-OrientedArchitecture
Leon Chism/Steve HoffmanChief Internet Architect/Engineering FellowOrbitzwww.orbitz.com
A Low-Cost Alternative toEnterprise JavaBeans™ (EJB™)Architecture