orientdborientjs

Clarification on orientjs


I have a few questions about this example from the orientjs github docs:

   var server = OrientDB({
     host: '10.0.1.5',
     port: 2424,
     username: 'root',
     password: 'root',
     servers : [{host : '10.0.1.5' , port : 2425}]
    });
  1. I assume the servers array doesn't need to contain the server specified in host and port (i.e. 10.0.1.5:2424 in the example)? In other words, this one is included in the list?
  2. The list of servers (including the one specified in host and port) are only used on the initial connection, after which the list of servers in the cluster are automatically maintained as they come and go?
  3. How is the target server selected (first available, round-robin, randomly, load balanced, etc.)?
  4. Is the server only selected per-connect (as opposed to per-query/transaction)?
  5. What happens if the selected server fails? Is a new connection attempted to a different server transparently or is some exception generated that requires the calling code to participate in selecting a new server?

Solution

  • 1) yes does not need to contain the server.

    2) yes they are used for the first connection then, when connected each time the cluster shape changes the driver gets notified.

    3) The connection is established with the first in the list. then it will stick there until fails.

    4) per-connect

    5) transparently retry the next server in the list