Storage System

From AardRock Wiki
Revision as of 14:59, 6 June 2006 by Chris (talk | contribs)
Jump to navigation Jump to search

The Storage System of Cheetah is inspired by the Wizard, Rabbit and Treasurer.

The Wizard is the part of the application that contains the logic and the user-interface. It uses the Storage System to store and share objects. The Storage System typically consists of the following components:

  • The Delegator
  • The Rabbit
  • The Treasurer

These components all share the same interface. You can see the network as a graph. With these components, the internal nodes are always Delegators, and the external nodes ultimately store the data. You can ask every type of node for a specific object, and the question will be propagated until an external node is found.

The Interface

A component can handle these two questions:

  • Give me an object with this id
  • Save this object for me with the following id

The Components

The Delegator

The Delegator has a list of other components. Typically, it has a Rabbit, a Treasurer (which store data locally) and other Delegators (via the network). It also has a rating for all these components. When a Delegator gets a question, it delegates these questions to the other components. The components with the highest rating gets the question first. Also, if a result is returned from a specific component, it will get a higher rating.

Maybe the Delegator can also ask for ratings of other components, but that might not be necessary.

The Rabbit

The Rabbit is a storage system that stores the data in a quick memory (typically: RAM). The lifetime of the data is not very long, compared to the Treasurer. When the application quits, the data is lost. The Rabbit never communicates with other components.

The Treasurer

The treasures provides a more permanent way of storing data. When the computer is shut down and restarted the data of the Treasurer will still be there.

Example

Below you will see an example graph representing a part of the network. The part inside the box is typically in the same JVM.

Wdrt.png

The Wizard is connected to a Delegator, and the Delegator has a Rabbit and a Treasurer. This is predefined by the application architects, but can be changed. The other Delegators are automatically found. How this is done, is currently an open issue.

Open Issues

  • How do Delegators find each other?
  • How do we get unique id's?
  • What happens if two different objects are returned? I.e., how do we make sure we have data integrity?
  • What do we do when an object is changed?