280 likes | 394 Views
Overview. Linda/TupleSpace JINI JavaSpaces (Sun Microsystems) TSpaces (IBM) TSpaces vs. JavaSpaces Future direction. Linda and Tuplespace. Parallel coordination language Virtual shared memory system on heterogeneous networks Associative address through efficient hashing
E N D
Overview • Linda/TupleSpace • JINI • JavaSpaces (Sun Microsystems) • TSpaces (IBM) • TSpaces vs. JavaSpaces • Future direction
Linda and Tuplespace • Parallel coordination language • Virtual shared memory system on heterogeneous networks • Associative address through efficient hashing • Simple language primitives allow minimal code rewriting • Tuple = basic element, list of literals and vars • In(), Out() moves “tuples” to/from TupleSpace • Eval() spawns processes in Tuplespace • Rd() does non-destructive reads in TupleSpace
Benefits of Linda • Portability (supports heterogeneous network) • Scalability • Dynamic load balancing • Anonymous and asynchronous communication • Associative addressing / pattern matching • Data persistence independent of creator • Simple API --> less and easier coding • Ease of code transformation
Linda Limitation (1) • High system overhead - no leasing • Designed as a parallel computing model, primarily for LAN • lack of security model • lack of transactional semantics • Language specific implementation • Blocking calls, but no notification mechanism
Linda Limitation (2) • Dynamic Locate the Service? • Simple type semantics • Operator is insufficient
JINI • Realization of a distributed computing environment • Allow services (hardware and software) being amended using a simple “plug and play” model • Provide distributed infrastructure like CORBA, DCOM • Services includes Transaction Manager, JavaSpaces, Security, Leasing, user implemented services, and etc.
JINI Components • Service - independent functionality made available to the other users remotely • Client - a device or software component that would like to use a service • Lookup Service - acts as a broker between the needs of the client and the services it knows about the network
JINI Principles • Services proxies carry the code needed to uses services • A “Lookup Service” lets your find and access services • Discovery is used to find proxies for the lookup service • Event-driven LookupDiscoveryManager - discovered(), discarded() defined in interface DiscoveryListener • Service Template is used to locate the Service Proxies
JINI Transaction • Transaction (two-phase commit protocol) • ACID is jointly implemented by various processes taking part in a transaction • Transaction manager will hand out a lease for newly created transaction • Nested transactions allowed
JINI: Caching & Replication,fault Tolerance, and security • Caching & replication are left to applications • Jini expects that components which use Jini as basis implement own fault-tolerance measures • Security • Relies on the security provided by Java RMI • JAAS: Java Authentication and Authorization Service
JavaSpaces (Sun Microsystems) • Lightweight infrastructure for network applications • Distributed functionality implemented through RMI • Entries written to/from JavaSpace with “write, read, readIfExists,take, takeIfExists, snapshot” • “notify” notifies client of incoming entries within timeout • Pattern Matching done to templates with class type comparisons, no comparison of literals. • Transaction mechanism with a two phase commit model • Entries are written with a “lease”, so limited persistence with time-outs
Key Features • All entry fields are strongly typed for matching • Matches can return subtypes of templates types • Entries are “leased”; persistence is subject on renewal in order to reduce garbage after failures • Support transient and persistent JavaSpaces • Multiple JavaSpaces cooperate, and transaction span multiple spaces. Partitions provide minimal protection • “Eval” functionality Is not supported, in order to reduce complexity and overhead • Transaction model preserves ACID properties
JavaSpace Limitation • Simplicity of or lack of security model • Transactions required for reliable entry reads • Java RMI = performance bottleneck? • High overhead from repetitious object serialization
TSpaces (IBM) • A set of network communication buffers that work primarily as a global lightweight database system or data repository • Operators include blocking and non-blocking versions of read and take, write, set operations scan and count, and synchronization operator. • Interfaces with data management layer to provide persistent storage and data indexing and query. • Dynamically modifiable behavior
Key Features • Database indexing and arbitrary “match, index, and, or” queries • Transaction layer for data consistency • Matching available on simple types • New operators can be downloaded to TSpace and used immediately • User and group permissions can be set on a Tuplespace and operator basis • Event register informs client of events • HTTP server interface for debugging and maintenance purpose • Support for large objects through URL reference
Simple types and objects as tuple fields No replication, 1 server per TSpace Access Control Lists on users and groups Event Register invoked on all events Database indexing and range queries Downloadable operators Only serializable objects allowed Severs can be replicated across nodes Protective partitioning using multiple JavaSpaces Notify() is only invoked for committed writes TSpaces vs. JavaSpaces
Messaging and Queuing System • IBM MQSeries • Sonic MQ • Microsoft Message Queue Server (MSMQ)
What is JMS? • A common Java API for creating, sending, receiving and reading messages • Enables communication that is Loosely couples • Reliable • Asynchronous • Designed by Sun and partners
JMS functionality • Messaging Models • Point to Point • Publish / Subscribe • Message Delivery • Synchronous or Asynchronous • Reliability provided by acks • Message selector • Transactions
Consumes Client One Sends QUEUE Client Two Ack Point to Point
Subscriber SSL Subscriber SmartSockets Cloud Subscriber TCP Multicast Publisher Subscriber Subscriber TCP Subscriber Subscriber Publish / Subscribe
Message Types • Text Message • Object Message • Byte Message • Stream Message • Map Message
Message Selector • Specify messages by message header and/or message properties • Can not reference message body values • Syntax is based on a subset of SQL 92
Web Services • Follow my presentation in JavaOne conference