Skip to content
appaquet edited this page Apr 19, 2012 · 12 revisions

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.

Design

Design

Cluster

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.

Cluster manager

Manages nodes membership to rings and the status of each membership (up, down, joining, leaving).

Service

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).

Action

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).

Resolver

Actions use the resolver to find on which node a request should be sent.

Protocol & codec

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.

ConsistencyManager

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.

Clone this wiki locally