solidDB Help : solidDB Grid : Table partitioning : Determining where the data is stored
  
Determining where the data is stored
Note Check the solidDB Release Notes for any limitations that are associated with using a grid in the current release.
In a solidDB Grid environment. partitioned tables are created by using the PARTITION BY clause with the CREATE TABLE statement, see CREATE TABLE.
The table is created on every node in the grid but, if the number of nodes in the grid is greater than the value of the replication factor, each table is associated with only a subset of the replication groups. The replication groups and their primary replication units are distributed evenly across the grid nodes.
For example, the following diagram shows a grid with four nodes and a replication factor of three (that is, each replication group has three replication units). The table TAB is created on each node. Two of the replication groups for the table are shown in the diagram.
Replication group RG1 has the primary replication unit on NODE2 and secondary replication units on NODE1 and NODE3.
Replication group RG2 has the primary replication unit on NODE4 and secondary replication units on NODE2 and NODE3.
This graphic is described in the surrounding text.
When rows are added to the table, each row is assigned to a replication group. The replication group for each row is determined by the partitioning key. The partitioning key is passed to a distribution formula and the output of the function is mapped to a replication group.
The row is inserted into the table on the node that hosts the primary replication unit for the replication group and is then replicated to the other replication units in the group.
For example, in the following diagram, a row with the partitioning key value of A is inserted into the TAB table. The distribution formula determines that the row belongs to the RG1 replication group. The row is added to the TAB table on the node that hosts the primary replication unit for the RG1 replication group (NODE2) and is then replicated to the other nodes in the replication group.
This graphic is described in the surrounding text.
The process is repeated as other rows are added to the table.
For example, in the following diagram, a row with the partitioning key value of B is inserted into the TAB table. The distribution formula determines that the row belongs to the RG2 replication group. The row is added to the TAB table on the node that hosts the primary replication unit for the RG2 replication group (NODE4) and is then replicated to the other nodes in the replication group.
This graphic is described in the surrounding text.
Go up to
Table partitioning