-
Notifications
You must be signed in to change notification settings - Fork 12
Concepts
This is a very brief description of las2peer concepts to give an insight into the ideas behind las2peer service development. For a more formal and extensive introduction, please refer to the technical paper.
las2peer is decentralized. This means, that las2peer runs on multiple nodes and not on a single machine. Multiple nodes form a network. To participate in a network, a node can connect to a network. All nodes in the network share their data with each other and can communicate with other nodes. Shared data is replicated to increase throughput and fault tolerance.
For the basic functionality, we use FreePastry as an overlay network. However, las2peer can run on any overlay network that provides data storage and communication primitives. The main goal of las2peer is to provide concepts on top of this network that makes p2p and service development easy.
Each action in a las2peer network is performed by an agent (see Actor–network theory). An agent can represent a user, a service, groups of agents, ... . Nodes host these agents passively. Agents can
- send messages to other agents and
- encrypt and store data to the network.
Most agents have a public and private key for encryption. Agents are stored to the network to make them available to the network, protected with a passphrase.
Envelopes are pieces of data stored to the network. This content is encrypted and signed using agents. The signing agent owns the envelope and is the only one who can edit or delete the envelope. Furthermore, additional agents with read-only access can be defined.
Services are built on top of the agent concept: A special agent type, ServiceAgent
s, execute services in the network. Note that a service may be executed by multiple agents. Each service is identified by its name and version.
las2peer services are uploaded to the network and stored decentrally as envelopes. The network decides where to start which version, and scaling up a service is done in the background.
A service can define public service methods available to the network. These methods can be called. A service call is stateless, meaning that no data is shared between these calls on the service side. It is even possible that two service calls to the same service are executed on different machines, which allows las2peer to balance load across the network. However, the service developer does not need to know about this, service calls are completely transparent, as long as user-related information is stored decentrally in the network.
When calling a service, a service version can be specified. las2peer choses the best fitting service version available in the network. To increase API compatibility, a sufficiently precise definition of the version should be given.
On the service side, each RMI call has an execution context allowing the service to act as the calling (main) agent.
A connector is the bridge between the las2peer network to the outside world and implements a specific protocol. Currently, a WebConnector implements access to services via a RESTful interface.
The WebConnector can only call special services that define a RESTful interface. The service can do so by using the RESTMapper.