solidDB Help : solidDB Grid : Routing data in a grid
  
Routing data in a grid
Note Check the solidDB Release Notes for any limitations that are associated with using a grid in the current release.
When an application uses a grid to store data, the following factors determine where and how a statement is executed, and whether the statement executes successfully:
whether the application connects to the grid by using grid-aware connect strings (a grid connection) or by using a direct connection to a specific grid node,
if using a grid connection, whether the application is already connected to a grid node (as a result of a previous operation),
whether the statement is a read operation, a write operation, or a procedure call,
whether the statement is part of a multi-statement transaction,
whether the statement acts on a single row of data or on multiple rows,
whether the data on which the statement acts is stored in a partitioned table, a non-partitioned (shared) table, or both,
the location of the primary replication unit for the partition of each row of data on which the statement acts.
Both the grid-enabled drivers and the grid nodes have a role in routing a statement to the node where it is executed. The following flow chart shows, at a high level, how statements are routed to grid nodes, and the conditions under which the statements are expected to execute successfully or to fail.
For simplicity, the following situations are not covered in the flow chart:
Application connects directly to a grid node rather than by using a grid connection.
SET GRID READ LOCAL is used to force the statement to execute on the current node and not be routed to another node in the grid. For more information, see SET GRID READ.
Statement is a DDL statement. DDL statements are always routed by the grid-enabled driver to the node that is the grid leader and executed there first. The grid leader then routes the statement to other grid nodes as required.
Statement is ADMIN COMMAND. Admin commands are always routed by the grid-enabled driver to the node that is the grid leader and executed there. To execute an admin command on a node that is not the grid leader, you must create a direct connection to the node.
Diagram that summarizes the routing of statements in a grid
Notes
(*) - transaction might succeed if distributed write mode is enabled, see Managing distributed non-transactional write operations.
For brevity, the term ‘primary partition’ is used to mean ‘primary replication unit for the partition’.
For more information about the role of the drivers, see Driver routing operations.
For more information about the role of the grid nodes, see Node routing operations.