-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
NRV is a flexible cluster-aware RPC framework with a REST twist. Its goal is to ease the creation of distributed systems running on a cluster of machine. It can use different protocols (NRV, HTTP, etc.) and supports different codec over those protocols (HTTP-REST, Java encoding, etc.). It supports different type of cluster management (statically defined nodes or dynamic with ZooKeeper). NRV uses consistent hashing to distribute the calls (or service data) among service members. Each physical node can have 0 to n membership (virtual node) in the ring (like Amazon's Dynamo) for a better balancing.
Contains services and nodes that have memberships into those services. Each node can have 0 to n membership per service, making it possible for a node to handle more than one section of the consisten hashing ring.
Manages nodes membership to services and the status of each membership (up, down, joining, leaving). The cluster manager can be static (StaticClusterManager), which gives a static view of the cluster in which all nodes are always up, or dynamic (ZookeeperClusterManager), which uses Zookeeper to maintain a consistent view of the cluster among nodes.
Service on which actions can be executed. Actions are executed on remote (or local) nodes and endpoints are resolved by the resolver. In a REST URL, the service would be the host (http://service/path).
An action is a function that can be executed on a service. In a REST URL, the action is the path (http://service/**path**). In the previous diagram, MyService creates actions on the service can listen to incoming request by binding a callback to the action (onReceive).
Actions use the resolver to find on which node a request should be sent.
Actions use a protocol to send a request to remote nodes. The protocol alone doesn't know how to encode requests, it uses a Codec to encode messages over the protocol.
A consistency manager implementation manage consistency for actions with implemented tradeoffs. Since it's impossible to have more than 2 guarantees between Consistency, Availability and Partition Tolerance in a distributed system, a service can define the consistency that it wants to use for its actions. For a database per example, the consistency manager could be a master-slave architecture, make it possible to manage the consistency and the availability of the cluster, but won't be able to resist to a network partition.
