Scope: managed applications, mobile applications, and ordinary applications.
1. When designing accumulation registers, note that balance of a single dimension set is stored in a single register resource. That is, the degree of parallelism when working with the register actually depends on its dimensions. Choose dimensions depending on how finely balance must be "cut" based on the application functionality.
2. If dimensions do not ensure the required parallelism when working with the register, we recommend that you use the totals separation mode similarly to accounting registers.
Note that the totals separation mode will not ensure parallelism upon register balance control. If balance control is necessary, move it to the end of the transaction as close as possible.
Consider, for example, the ProductStock accumulation register with the following dimensions:
Example 1
Suppose that two users simultaneously post documents that add records to this accumulation register. In this case, the first user writes the following record set:
# | Warehouse | Products |
1 | Main warehouse | Rocking chair |
2 | Main warehouse | Kitchen unit |
3 | Warehouse #2 | Furniture set |
The second user writes the following record set to the same register:
# | Warehouse | Products |
1 | Main warehouse | Furniture set |
2 | Warehouse #2 | Rocking chair |
These record sets do not contain rows with matching dimension values. In this case, there will not be waiting upon lock.
Example 2
Suppose that the second user writes the following record set:
# | Warehouse | Products |
1 | Main warehouse | Kitchen unit |
2 | Warehouse #2 | Rocking chair |
3 | Wholesale warehouse | Bedroom set |
This record set contains a row (#1) that matches all dimension values of a row of the record set of the first user (#2).
In this case, there will be waiting upon lock and one of the users will wait for the operation of another user to finish. That is, the overall system performance will decrease.
The accumulation register also supports the totals separation mode, which will allow users to avoid locking in this situation (see Example 3).
Example 3
If the totals separation mode is enabled for this accumulation register, it will be possible to write two sets in parallel even if they contain similar (in dimension values) rows.
However, if balance control is used, the totals separation mode will not produce a positive effect. That is, for the accumulation register, the totals separation mode works similarly to the accounting register. To reduce the effect of this lock on the overall system performance, you need to move balance control to the end of the transaction as close as possible.