Survival of the fittest Jini services, Part 2
Use transactions to coordinate the reliable interaction of Jini services
By Frank Sommers, JavaWorld.com, 07/20/01
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
Failure, according to Merriam-Webster's Dictionary, is a state in which something is "unable to perform a normal function."
Inasmuch as a network's normal function is to transmit information between two or more hosts, experience shows that most networks
often cannot perform that function as expected. In other words, failure is as much a characteristic of the network as is its
normal operation.
Read the whole "Survival of the Fittest Jini Services" series:
In many aspects of life, we have learned to live in the presence of failure. In a large city, many new shops spring up all
the time, while others close their doors for good. Unless you are a shop owner, you are not likely to lose sleep over that
fact. Instead, you are interested in being able to obtain the goods you are looking to buy, at a reasonable price and in close
proximity.
Taking a similar approach to building Jini-based distributed systems might be helpful. We cannot make a large network, such
as the Internet, more reliable. But we can make the computations we wish to perform over that network as reliable as possible. Your users -- whether people or other
Jini services -- are primarily interested in the computations your service provides. Ensuring the reliability of those computations
in the presence of network and component failures will likely lead to your service's longevity.
By reliability I mean a set of guarantees that hold, no matter what. In other words, as long as the computation produces a result, that
result should keep with a set of guarantees. If the computation cannot ensure those guarantees, then it should abort and not
return a result.
We are all familiar with this notion of reliability: When people wish to accomplish a goal together, they typically agree
to a verbal or written contract, which thereafter binds each party to its terms. Thenceforth, the participants perform all
their actions related to the common task in accord with those promises. And, should the parties fail to keep their promises,
all actions under contract will produce "unreliable" and unpleasant results.
The equivalent of such "rules of the game" between components of software-based distributed systems is the transaction: components participating in a computation agree to a set of rules, and each component thereafter adheres to those rules during
the computation.
In distributed systems, such as Jini networks, components typically reside on distant network hosts. This is significant,
because it means that no component can, by itself, ascertain whether the other components adhere to the rules. A component
can only implement the rules and then communicate to the others that it, indeed, keeps with those rules.
Distributed transactions, therefore, are made up of the rules (semantics) by which the services must abide, and a coordination
mechanism between the services that ensures that the rules hold for the whole computation. If even one service indicates that
it cannot guarantee its promise, that mechanism will abort the transaction.
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
Resources
- Read Frank Sommers's complete "Survival of the Fittest Jini Services" series in JavaWorld:
- The Jini Transaction Specification
http://www.sun.com/jini/specs/jini1.1html/txn-spec.html
- Transaction ProcessingConcepts and Techniques, by Jim Gray and Andreas Reuter (Morgan Kaufmann, 1993; ISBN1558601902) is the most comprehensive book on transactions. With
its thousand-plus pages chock-full of brilliant insights, it is not for the faint of heart, but is a very rewarding read.
Gray and Reuter themselves invented many of the concepts presented in the book
http://www.mkp.com/books_catalog/catalog.asp?ISBN=1-55860-190-2
- Philip Bernstein's Transaction Processing for the Systems Professional (Morgan Kaufmann, 1996; ISBN1558604154) is an excellent introduction to transaction processing. It also gives a grand tour
of all the significant transaction processing systems in use today
http://www.mkp.com/books_catalog/catalog.asp?ISBN=1-55860-415-4
- You can also download the full text of Philip Bernstein, Vassos Hadzilacos, and Nathan Goodman's Concurrency Control and Recovery in Database Systems from
http://research.microsoft.com/pubs/ccontrol/
- Gerhard Weikum and Gottfried Vossen's Transactional Information SystemsTheory, Algorithms, and the Practice of Concurrency Control and Recovery (Morgan Kaufmann, 2001; ISBN1558605088) focuses on recent advances in transaction models and their formal analysis. It also
discusses crash recovery techniques for object systems, which is very relevant to high-availability Jini services
http://www.mkp.com/books_catalog/catalog.asp?ISBN=1-55860-508-8
- Advances in the field of distributed and multidatabase management systems may prove helpful in gaining a better understanding
of the interaction between multiple Jini services. Tamer Ozsu and Patrick Valduriez's Principles of Distributed Database Systems (Prentice Hall, 1999; ISBN0136597076) is excellent, and has a chapter devoted to distributed transaction processing
http://vig.prenhall.com/catalog/academic/product/1,4096,0136597076.html,00.html
- To better understand the issues of controlling concurrency in distributed systems, Nancy Lynch's Distributed Algorithms (Morgan Kaufmann, 1996; ISBN1558603484) is an excellent reference. It has a section on consensus algorithms (where many parts
of a distributed system have to reach some sort of an agreement, and do this quickly, without eating up a lot of bandwidth),
an entire chapter on atomic objects, and a discussion on partial failure (and what to do about it)
http://theory.lcs.mit.edu/tds/distalgs.html
- My example of the generals' problem was inspired by Leslie Lamport's "Byzantine Generals" problem, which is described in his
fascinating paper from 1982. Lamport's more difficult problem is, How can the generals reach an agreement if there is a traitor among them? The following Websites have information about the paper:
-
- If you thought that Jini transactions were a complex beast, imagine when pieces of these transactions start to physically
move about! Mobility brings a new set of challenges to distributed transactions. Evaggelia Pitoura and George Samaras's Data Management for Mobile Computing (Kluwer Academic, 1997; ISBN0792380533) is a good introduction
http://www.wkap.nl/book.htm/0-7923-8053-3
- Pitoura's Website has a wealth of information about the impact of mobility on distributed systems
http://zeus.cs.uoi.gr/~pitoura/pub.html
- If you are pressed for time, I wrote up a short outline for a tutorial on mobile transactions
http://www.autospaces.com/people/fsommers/mobile_transactions.pdf
- Panos Chrysanthis's homepage
http://www.cs.pitt.edu/~panos/publications/all.html
- Margaret Dunham's homepage (articles from the late 1990s; especially relevant is "A Mobile Transaction Model that Captures
Both the Data and Movement Behavior")
http://www.seas.smu.edu/~mhd/pubs.html
- Tomasz Imielinski's mobile computing project page
http://www.cs.rutgers.edu/dataman/
- A complete listing of Jiniology articles
http://www.javaworld.com/javaworld/topicalindex/jw-ti-jiniology.html
- Bill Venners's Jini FAQ
http://www.artima.com
- The Jini community Website has pointers to all things related to Jini
http://www.jini.org
- The Sun Jini page contains success stories, whitepapers, and so forth on deploying Jini services in business environments
http://www.sun.com/jini
- Subscribe to the JavaWorld This Week weekly email newsletter to find out what's new on JavaWorld
http://www.idg.net/jw-subscribe
- You'll find a wealth of IT-related articles from our sister publications at IDG.net