In the glossary for Microsoft Dynamics AX, the formal definition of a partition is:
“A division of an application’s processing into logical or functional parts”.
In previous releases of Microsoft Dynamics AX, the DataAreaId column in a table was used to provide the data security boundary. It was also used to define legal entities through the concept of a company. As part of the organizational model and data normalization changes, a large number of entities like Products and Parties that were previously stored per-company, have been updated to be shared (through global tables) in Microsoft Dynamics AX 2012. This was done primarily to enable sharing of data across legal entities and to avoid data inconsistencies.
But in some deployments of Microsoft Dynamics AX, data is not expected to be shared across legal entities. In such deployments, the DataAreaId column is primarily used as a security boundary to segregate data into various companies. Such customers want to share the deployment, implementation, and maintenance cost of Microsoft Dynamics AX, but they have no other shared data or shared business processes. There are also holding companies that grow by acquiring independent Businesses (subsidiaries), but the data and processes are not shared among these subsidiaries.
Microsoft Dynamics AX 2012 R2 provides a solution to these requirements by introducing the concept of data partitioning by adding a Partition column to the tables in the database. This allows the data to be truly segregated into separate partitions. When a user logs into Microsoft Dynamics AX, he or she always operates in the context of a specific partition. The system ensures that data from only the specified partition is visible, and that all business processes run in the context of that specific partition.
Purpose of Partition
The purpose of a partition is to logically separate the data within its boundaries from the data in other partitions. A partition enables the AOS to isolate the data in the partition from users who are not authorized to access the data.
For example, a holding corporation might have several subsidiaries or other legal entities. An installation of Microsoft Dynamics AX for the corporation can have several partitions, perhaps one for each subsidiary.
Relation between Legal Entities and Partitions
Each partition contains at least one company or legal entity. A legal entity occurs in only one partition. When you create a legal entity, the system assigns it to the current partition. The legal entity can never be moved to another partition. However, its data can be exported from the partition and then imported to another company in another partition.
A new property named SaveDataPerPartition has been added for all tables in the AOT. By default, the value is set to Yes, and the property cannot be edited. This property can be edited only if the SaveDataPerCompany property is set to No and the table is marked as a SystemTable, or if the table belongs to the Framework table group. These checks are put in place to enable all application tables to be partitioned. Only specific tables that are used by the kernel can have data that is not partitioned.
All of the tables whose SaveDataPerPartition property is set to Yes have a Partition system column in the metadata. In the database, the table has a PARTITION column with a data type int64. It is a surrogate foreign key to the RecId column of the Partition table. This column always contains a value from one of the rows in the Partition table. The column has a default constraint with the RecId value of the initial partition. The kernel adds the Partition column to all the indexes in a partition-enabled table except for the RecId index.
- You can know the current partition through “getcurrentpartitionrecid()” similar to “curext()”
- Batch servers work across partitions
- AIF works across partitions
- AIF, Batch tables – Save data per partition is set to “No”, because those are shared across partitions.
- No cross company queries on partitions are allowed like the crosscompany query.
- To provide strict data isolation, the framework does not provide the ability to change partitions programmatically at run time. To change the partition, a new session has to be created that is set to use the other partition or you can set in the client configuration.