METHOD OF MANAGEMENT OF SPLITTING THE INFORMATION OBJECT
STORED IN A SINGLE DATABASE
Field of Invention
The invention relates to the multitenancy architecture that serves tenants from multiple organizations in an isolated manner and more particularly to the method for automated management of splitting the information objects stored in a single database into individual pieces.
Multitenancy can be used to serve tenants from various organizations (i. e. independent subscribers) in an isolated manner within a single service (installation or deployment). The key is to ensure that subscribers remain isolated from one another.
Prior Art
Known prior art includes solution US 2013/086322A1 that describes a method of splitting tables data by adding one or more fields (columns) to be used as discriminators.
However, this method tends to be quite time-consuming since each time one or more new discriminator columns have to be added to each table or catalog.
Object of Invention
The object of this invention is creating a mechanism and method for flexible management of data splitting, i. e. by enabling or disabling data splitting for the same applied solution, e. g. to ensure it can work both in the local ("desktop") mode and in the mode where multiple subscribers access the same web-service ("cloud splitting") with no significant modifications to the architecture of the applied solution itself.
The technical result of the invention provides for both complete and partial data splitting. For instance, some data can be shared by all organizations (e. g. a catalogue of banks) while other data, such as business or financial data, is tenant- specific and only displayed for and available to a specific organization.
Definitions
Configuration is an applied solution that is based on the 1C platform and is a combination of algorithms, forms and data structures. The main purpose of any
configuration is the correct record-keeping, e. g. for accounting purposes. The 1C platform is a set of specialized objects used for storing data specific to a subject area: constants, catalogs, documents and charts of accounts.
Attributes are fields in a catalogue or document to be filled in that are displayed in an applied solution. Each attribute is characterized by properties specifying what type of values it stores and how a user can work with it.
Delimiter (Shared Attribute) is a metadata object (configuration object) that enables usage of a single attribute for multiple configuration objects (catalogs, documents, charts of accounts, constants, etc.). A configuration developer can add and configure "shared attributes" to avoid modifications to the standard configuration objects. In other words, the developer can set and manage a shared attribute for all or some objects, rather than add delimiter columns to each existing catalogue (referred to as a "table" in the prior art). The "shared attribute" object has got certain predefined properties, such as Name, Content (a list of objects or catalogues where the shared attribute is to be used), Value, Usage of split data.
Metadata is a configuration object that describes the relevant data layout and its interaction with the database.
Session parameters are shared configuration objects. A certain current value is set and stored within the current 1C:Enterprise session. For instance, session parameters can be used to restrict access to data at the entry level.
The technical result is achieved by a combination of advantages of the invention as described below. In the first embodiment of the invention, the method for automated management of splitting the information objects stored in a single database comprises: creating preliminarily at least one metadata object, the "shared attribute", that serves as a delimiter and stores a reference to at least one split information object and a source of values for the delimiter; setting the "shared attribute" parameters that define how it is used in at least one split information object; setting the metadata object named "session parameters" that stores IDs of tenants and/or tenant groups that need to be granted access to various split information objects and also stores the current delimiter values; identifying specific tenants and/or tenant groups and defining the current values for each delimiter metadata object upon the start of the database session; assigning an isolated data area to each tenant and/or
tenant group, with said area containing metadata objects with an added "shared attribute"; writing the "shared attribute" value into a corresponding column when writing data into split information objects where the "shared attribute" metadata object is added; generating queries to obtain data from the data areas assigned to a particular tenant and/or tenant group.
In case of a particular embodiment of the invention, if the "Auto-use" property relative to the "shared attribute" parameters is set to "Use", the created "shared attribute" is automatically added to all existing configuration objects as well as to all newly created configuration objects. If the "Auto-use" property relative to the "shared attribute" parameters is set to "Do not use", the attribute is not automatically added to configuration objects; objects that need the delimiter to be added are selected with the "Content" property of the delimiter.
In the second embodiment of the invention, the method for automated management of splitting the information objects stored in a single database comprises: creating preliminarily at least two "shared attribute" metadata objects to be used as delimiters, with each object storing a reference to at least one split information metadata object and a source of values for the delimiter; including references to a splittable constant containing conditional split flags, "True" or "False", which is a part of another delimiter itself , in the delimiter that references the split information objects; setting the metadata object named "session parameters" that stores IDs of tenants and/or tenant groups that need access to various split information objects and also stores the current delimiter values; identifying specific tenants and/or tenant groups upon the start of the database session, thus defining the value for each delimiter; assigning an isolated database to each tenant and/or tenant group, with said database containing metadata objects and used to assign a data area for each tenant and/or tenant group by means of filtering by the "shared attribute" value and the conditional split flag value; writing the delimiter value into a corresponding delimiter column when writing data into split information objects referenced by the delimiter; generating queries to obtain data from the data areas assigned to a particular tenant and/or tenant group. In case of a particular embodiment of the invention, the database contains, apart from the split information objects, at least one shared object that, regardless of the session parameters and the conditional split flag value, can be accessed by all users, at least for read operation. In addition to its content and value, the "shared attribute"
object also contains an indication of whether split data can be used in the shared mode that can have at least one of the two values, "True" or "False", and tenants and/or tenant groups are identified and current session parameters are set when the database session is started. If the shared mode is set to "True" and these users call information objects in the database, current session parameters are ignored and access is granted to a random set of entries in split information objects, depending on the program controlled set of delimiter values, at least for read operation.
Disclosure of Invention
Management of data splitting must be flexible to provide enabling or disabling data splitting for the same applied solution, e. g. to ensure it can work both in the local ("desktop") mode and in the mode where multiple subscribers access the same web- service ("cloud splitting") with no significant modifications to the architecture of the applied solution itself. Moreover, it needs to enable and disable splitting specific objects in a storage, such as tables, to partially isolate the data and make it available to a single subscribing tenant while other data can be shared by all or some tenants.
The principle of data splitting is based on a new configuration object, the "shared attribute".
The mode of shared attribute operation is set using the Data Split property. There are two modes of this configuration object:
1. If the "Data Split" property is set to "Do not use", the created configuration object is only used as an attribute included in multiple (or all) configuration objects.
2. If the "Data Split" property is set to "Split", the shared attribute is used as a data delimiter.
This method provides for management of stored data splitting in an infobase and of applied solution operation.
The first embodiment of the claimed invention represents a relatively simple method of splitting using at least one delimiter.
In the second embodiment, a more complex method of data splitting is described using two or more delimiters. An advantage of this method lies with its ability to manage data splitting using conditional data split.
A splitting mechanism that characterizes the splitting method provides for both partial and complete data splitting. For instance, some data can be shared by all organizations (e. g. a catalogue of banks) while other data, such as business or financial data, is tenant-specific and only displayed for and available to a specific organization.
This approach greatly simplifies administration and updating of applied solutionsin cases when a single applied solution is used for record-keeping in multiple organizations.
The first embodiment of the splitting method comprises creating a single shared attribute metadata object that serves as a delimiter. The delimiter stores a reference to one or more split information objects. A source of values for the delimiter is also indicated. Parameters that define how the delimiter is used in one or more split metadata objects are specified for the delimiter. The metadata object named "session parameters" is set. It stores IDs for tenants and tenant groups that need access to various split information objects. It also stores the current delimiter value. When the database session is started, specific tenants and/or tenant groups are identified, and the current values for each delimiter metadata object are defined. This method also comprises assigning an isolated data area containing metadata objects with an added "shared attribute" to each tenant and/or tenant group . In addition, when information is written into split information objects in the database with the shared attribute, the value of the shared attribute is written into a corresponding column. As a result, queries are generated in order to obtain data from the data areas assigned to a particular tenant and/or tenant group.
If the created shared attribute needs to be automatically added to all existing and all newly created configuration objects, set the "Auto-use" property in the shared attribute parameters to "Use". However, if the "Auto-use" property is set to "Do not use", the attribute is not automatically added to configuration objects; objects that need the delimiter to be added are selected using the "Content" property of the delimiter.
In another embodiment of the splitting method (two or more delimiters), a shared attribute metadata object is also created and serves as a delimiter. Unlike the first embodiment, in this embodiment at least two shared attribute metadata objects are
created. It is assumed that the delimiter shall include references to a constant along with the split information objects from the database referenced by this delimiter. The constant containing conditional split flags, "True" or "False", is a part of another delimiter and is also split. Similarly to the first embodiment, the metadata object named "session parameters" is set. When a tenant is being identified and a session starts, an isolated database containing metadata objects is assigned and used to assign a data area for each tenant and/or tenant group by filtering by the "shared attribute" value and the conditional split flag value. Similarly to the first embodiment, this embodiment also comprises writing the delimiter values in a corresponding delimiter column when writing information into information objects in the database and generating queries.
Moreover, the database contains the split information objects together with a shared object that, regardless of the session parameters and the conditional split flag value, can be accessed by all users, at least for read operation.
In addition to its content and value, the "shared attribute" also contains an indication of whether split data can be used in the shared mode. This mode can have at least one of the two values: "True" or "False". When the database session starts, specific tenants and/or tenant groups are identified, i. e. current session parameters are set.
Detailed Description of Embodiments
In the first embodiment of the invention, the "Data Split" property is set to "Do not use".
Let us consider how this embodiment can be used in the 1 C software.
Before the software is launched, at least one delimiter is created by default in the Designer. This delimiter is used to automatically split the shared infobase into separate isolated infobases, each managed by its own administrator.
For instance, the shared infobase might include multiple infobases, each containing all documentation of a specific organization. If the Organization delimiter is used as a standard delimiter in the Designer, the shared infobase is split into multiple infobases, each of them isolated and operating in its own configuration with no access to documentation from other isolated databases.
Then create the "shared attribute" metadata object. For instance, you can do it by selecting Shared - Shared Attributes - Add new object in the Configuration window.
Next, properties of the shared attribute are specified.
A) Name of the shared attribute is specified in the Default property.
B) In the Use property:
Content of the shared attribute (the Content property) is specified using a drop-down menu displayed in the configuration edit window, i. e. a list of configuration objects which the shared attribute will be added to is compiled.
The window used to edit the shared attribute content is split into two parts, each containing information on whether the shared attribute should be applied to a particular object (the Use column):
- the upper part lists all configuration objects that can be included in the shared attribute content;
- the lower part lists objects with settings that are different from the default settings defined by the Auto-use property of the shared attribute.
If this property is set to "Use", the lower part of the window lists objects that are not included in the shared attribute content.
If this property is set to "Do not use", the lower part of the window lists objects that are included in the shared attribute content.
Configuration objects can be edited in either the upper or the lower part of the window. The edited configuration object will move between the parts of the window, depending on the value in the Use column.
For each configuration object, the Use column can be set to one of the three values:
1. Automatically: Assignment of the configuration object to the shared attribute depends on the value of the Auto-use property of the shared attribute:
- Use: The configuration object is included in the shared attribute content;
- Do not use: The configuration object is not included in the shared attribute content.
2. Use: The configuration object is included in the shared attribute content regardless of the Auto-use property value.
3. Do not use: The configuration object is not included in the shared attribute content regardless of the Auto-use property value.
The following configuration objects can be included in the shared attribute content: catalogues, documents, charts of characteristic types, charts of accounts, charts of calculation types, business processes, tasks, information registers, accumulation registers, accounting registers, calculation registers and exchange plans.
C) Then a drop-down menu in the configuration window is used to select how the shared attribute is used (the Auto-use property) in relation to the objects listed in the Content property.
If the Auto-use property is set to "Use", the created shared attribute is automatically added to all existing configuration objects (if using shared attributes is enabled for these objects) and to all newly created configuration objects.
If the "Auto-use" property is set to "Do not use", the attribute is not automatically added to configuration objects; objects that need the shared attribute to be added are selected using the "Content" property.
This property is also used if the shared attribute is auto-used, but there are objects where the shared attribute should not be added.
Then specify a metadata object named "session parameters". It stores IDs of entities (tenants) and/or entity groups (tenant groups) that need access to various split information objects.
Thus, when the system starts, session parameter values are initially set. These values store an indication of use and values of the delimiters based on the options of the startup command line or the values specified for the infobase user.
Then the system analyzes the entered data, in particular:
- it identifies specific tenants and/or tenant groups or otherwise sets current session parameters (e. g. based on the machine ID), thus defining a value for each metadata object;
- it identifies the specified delimiter values to be used for splitting the shared infobase (e. g. if the delimiter is set to Organization, the system splits the shared database into isolated databases by organizations);
- it identifies whether the shared attribute is set and, if so, it determines which configuration objects it need to be added to.
When all parameters are set, the shared infobase is split into multiple isolated infobases where the created shared attribute is added to the configuration objects used by the administrator, based on the specified parameters.
If the shared attribute split is conditionally disabled:
1. When reading and writing data, current values of the session parameters defining delimiter value and use are ignored.
Instead, the following values are used.
Use attribute - True (the default delimiter is used);
Delimiter value - default value for the delimiter type.
2. When reading and writing infobase users, current values of the session parameters defining delimiter value and use are ignored.
Instead, the following values are used.
Use attribute - False (the delimiter is not used).
Delimiter value - not used.
In the second embodiment of the invention, the "Data Split" property is set to "Split".
1. Before startup at least two delimiters are created in the Designer.
- At least one of multiple delimiters is set as a standard (main) delimiter and is used by default to automatically split the shared infobase into separate isolated database, each managed by its own administrator.
For instance, the shared infobase might include multiple infobases, each containing all documentation of a specific organization. If the Organization delimiter is used as a standard delimiter in the Designer, the shared infobase is split into multiple infobases, each of them isolated and operating in its own data area with no access to documentation from other isolated databases.
- Another delimiter represents a newly created shared attribute configuration object (subordinate delimiter) that can be created, for instance, by selecting Shared - Shared Attributes - Add new object in the Configuration window.
2. Then, as indicated above, set shared attribute properties, such as its name, use and content.
3. Then use a drop-down menu in the configuration window to select shared attribute splitting parameters (the Data Split property) in relation to the objects listed in the Content property.
In this embodiment the Data Split property is set to Split.
The shared attribute used as a delimiter has additional properties that affect the behavior of the system and modify the behavior of the configuration objects included in the delimiter content.
4. Then use a drop-down menu in the configuration window to select how the delimiter is used in relation to the objects included in the delimiter content (the Split data use property).
If the Split data use property is set to "Independent", there are no allowed calls to split objects if the current infobase session does not use a delimiter. In this case the delimiter is also unavailable in the object model, query language, dumps in XML and XDTO formats, and data access restrictions. When split data is written, the system automatically fills shared attribute values with values set in the current session.
This mode can be used when the applied solution only uses data from a single data area.
If the Split data use property is set to "Independent and Shared", the delimiter can be either used or ignored. In this mode a data area defined by values of the used delimiters is available. In this case the delimiter is also available in the object model, query language, dumps in XML and XDTO formats, and data access restrictions.
If a session does not use some of the delimiters that include a certain object, working with this object becomes less efficient.
Use this mode when an applied solution works mostly with data from a single data area (e. g. while entering documents) while in certain modes it might use data from multiple or all areas, e. g. for consolidated reports.
5. Then use a drop-down menu in the configuration window to select session parameters (the Data split value property) that store the delimiter value set in the current session. The session parameter type should be an exact match of the delimiter type.
6. Then use a drop-down menu in the configuration window to select how the shared delimiter is used in relation to the configuration objects in the current session (the Data split use property).
Using of the shared attribute delimiter management is based on the Boolean or constant type: if the specified session parameter is set to "True", the (subordinate) delimiter is used in this session.
7. Then use a drop-down menu in the configuration window to select conditional split parameters.
Conditional split is used when an applied solution is to be used in both split and unsplit modes.
For instance, the applied solution can be used offline (in this case delimiters are not used although they are included in the solution) or it can be used for a number of subscribers that are not related to each other (and have an independent set of data in the infobase).
This way of behavior can be implemented using conditional split: if the solution is offline, splitting is disabled; in the split mode it is enabled.
Conditional split functions as follows:
- An object that stores delimiter states can be set for a delimiter (or an object included in the delimiter content).
- Changing the value of this object can enable or disable splitting using this delimiter for all objects (if conditional split is set for the delimiter) or for the selected objects (if conditional split is set for an object included in the delimiter content).
- If the delimiter is conditionally disabled, the default value for this delimiter type is used.
As a next step, specify a metadata object named "session parameters". It stores IDs of entities (tenants) and/or entity groups (tenant groups) that need access to various split information objects.
Thus, when the system starts, session parameter values are initially set. These values store an indication of use and current values of the delimiters based on the options of the startup command line or the values specified for the infobase user.
Then the system analyzes the entered data, in particular:
- it identifies specific tenants and/or tenant groups or otherwise sets current session parameters (e. g. based on the machine ID), thus defining the current value for each delimiter metadata object;
- it identifies the specified current delimiter values to be used for splitting the shared infobase (e. g. if the delimiter is set to Organization, the system splits the shared database into isolated databases by organizations);
- it identifies whether a shared attribute is set;
- it identifies the shared attribute use mode (in this embodiment the shared attribute is used as a delimiter);
- it identifies configuration objects that require splitting by the shared attribute;
- it identifies the splitting mode for the shared attribute.
When all parameters are set, the shared infobase is split into multiple isolated databases. Within each isolated database, configuration objects are split (filtered) by the shared attribute and are combined in a new database based on the specified parameters.
Examples
Example 1. Conditional split using a constant set in the shared attribute properties.
A delimiter can be completely disabled using a Boolean-type constant ("True" or "False") that is not split by the attribute.
A configuration contains the Goods catalog, and a Number-type Company shared attribute is included in the metadata. Conditional split managed by the Split By Company constant is used for the Company shared attribute.
If Split By Company = False, it means the delimiter is not used (splitting is disabled) and vice versa.
If splitting is disabled, availability of the Goods catalogue will depend on the Split data use property.
If the latter is set to "Independent", none of the tenants (companies) will be granted access to the entries in the Goods catalog.
If said property of the shared attribute is set to "Independent and shared", all tenants will have access to all entries in the Goods catalog.
Example 2. Conditional split set for an object (in the Content property)
Conditional split can be set for each configuration object included in the content of the delimiter. In this case splitting is only disabled for objects that have conditional split set up.
Embodiments of conditional data split using a constant.
Assume that a developer has authored an applied solution with the main aim of customer and inventory accounting. Among other things, the applied solution contains two data storage entities: Goods catalogue and Contractors catalogue.
The solution has been ready-made for the local "desktop" mode; however, it now needs to be adapted to the cloud web-service mode. It is expected that at least two subscribers will be granted online access to the solution, and each of the subscribers will keep accounting records on behalf of at least two of its affiliated structures.
Assume there are two subscribers, each keeping accounting records on behalf of multiple affiliated companies. An arbitrary list of subscribers and their corresponding affiliated companies is represented below.
Subscriber A
- Company 1 ,
- Company 2.
Subscriber B
- Company 3,
- Company 4,
- Company 5.
Data for all organizations are stored in a single infobase in two catalogues: Contractors and Goods. However, in the most general case, users of a certain organization must only have access to the records of this particular organization.
It is further assumed that Subscriber A wants Organization 1 and Organization 2, since they are affiliated and managed by the same owner, to have access to the entire Goods catalog. Therefore, Organizations 3, 4 and 5 must be entirely isolated in their respective data areas, while Organizations 1 and 2 and any other organizations to be registered later and controlled by the Subscriber A group must have shared access to the Goods catalogue and be able to see all records pertaining to the goods of Subscriber A. At the same time, data areas of the Contractors
catalogue remain strictly separated by organizations, no matter which subscriber they belong to.
The delimiter includes multiple catalogues; two of them are split: Contractors and Goods. In the latter catalogue conditional split is further set up, depending on the current value of the Split Goods constant ("True" or "False"). In this case the Split Goods constant is split by subscribers, i. e. its value is different for each subscriber. The desired effect is achieved by setting this constant to "True" for Subscriber A and to "False" for Subscriber B.
A combination of the advantages listed in the independent claims of the invention is sufficient for the achievement of the claimed technical result.
The authors believe that the claimed solution meets all criteria of invention patentability.