Rinda is much like Linda or JavaSpaces
Rinda is more in the ruby spirit and uses DRb(Distributed Ruby).
Whenever you take a new project and put into the world for the first time you find all kinds of bugs and areas for improvement. Rinda is no different.
Rinda is a tuplespace.
Rinda clients or peers can write tuples into the tuplespace and take tuples out through matching style queries.
Tulpes can be requests to do some work or responses to the work.
Rinda participants do not directly know about other peers who make requests and responses.
Easy to scale, throw in more workers and the work gets done easier.
Clients can also do read operations and subscribe to notifications.
Take can block undefinitely or timeout.
Rinda also provides a broadcast RingServer to lookup and find Rinda tuplespaces on the network.
Rinda uses templates to match against candidate tuples present in the tuplespace.
The first matching criteria is the tuple size.
For each value in the template, the value is compared against the corresponding value in the candidate tuple.
Wildcard machings are possible.
If a tuple matches the template of a take operation that tuple is removed and returned.
When using Rinda, you are designing a protocol.
You need to think and document this “new protocol” you are designing
- tuple formats
- process roles
- interaction patterns and rules
- appropriate templates for each role and situations
- evolution of the protocol
Tuple most often require three generic parts
- Command or request name
- correlators (so you can tie requests/responses together)
- Associated data the arguments of the request or results of the response.
Rinda tips:
put variable-length items in their own arrays within the tuple, so that they are insulated from effecting the tuple size.
Exploit === operator which is used by the compare operator in the take function.
- Strings work well because you can us regexps
- Numbers work well because you can match with ranges
- Symbols and core classes don’t work as well because they don’t have rich triple equal operators
Rinda is not well suited for synchronous communication, unless you use correlators very carefully and cleanup old tuples used to synchronize previous communications.
Unlike RMI, DRb doesn’t have remote code loading. BEWARE. You as the programmer are responsible to make sure that the same version of custom classes are present on all participating nodes and that they have consistent versions. This makes code upgrades more difficult.
Rinda means you will have multiple processes.
RingServers, TupleSpaces, and Various Rinda Clients
Rinda makes possible construction of reliable systems out of unreliable parts.
Pitfalls or Improvements
- There needs to be a way to more explicitly specify what ring server and tuple spaces you are using especially in development and testing environments.
- Drb needs unforgable object ids, encypted communication sessions.
- There is no persistence support for the tuplespace
- Rinda needs transactions