Skip to content

Terminology

elandau edited this page Oct 25, 2014 · 3 revisions

Representations a network element being connected to. This could be represented by an IP address or other ID.

ServerSource : Observable

Source of host membership. Actions are Add and Remove. The ServerSource acts as the input to a ServerList implementation so it can know of the existing hosts.

Filter : Func1<Host, Boolean>

Filter hosts from the ServerSource so that they are never considered by the load balancer. Examples include zone or region aware filters

HostContext<Host>

Connection context for a host. The context tracks load balancer internal state for the Host which also includes a reference to the Client implementation

<Client>

Specify transport client implementation for a Host.

HostContextListSelector : Observable<List<HostContext>>

Source of ‘active’ hosts. Each subscription to ServerList will emit a single immutable list of hosts. This list will likely be cached and frequently updated based on membership changes and performance (i.e. weight) recalculations.

LoadBalancer : Observable<Client>

The load balancer implements the actual load balancing strategy on top of the List returned by the ServerList.

ClientConnector: Func1<Host, Observable<Client>>

Factory to construct a Client from a Host. This process may include async opening of the connection and therefore returns an Observable that will either emit the successful client connection or an error if failed.

Operation : Func1<Client, Observable<T>>

Representation of an operation on a Client which ‘translates’ the Client via a request to a response.

Eureka

Add(Server), Remove(Server)

ClientMetrics

Metrics associated with a single Host

Load balancing algorithms

RoundRobin

+1 cursor select element from list

WeightedRoundRobin

  • Array of weights [1,3,4,7] for server (a, b, c, d) => weighted array [1,4,8,15].
  • Either round robin and increment bin
  • Random number up to sum of weight (Random.nextInt(15)), find first bin that is > number

Fair queueing