Distributed information base: Basics. Distributed information base. Step-by-step instructions and pitfalls Creating rib

RIB is a distributed information base, which is a tree-like structure, the branches of which are individual deployed 1C Enterprise databases. These databases are called distributed information base nodes (hereinafter simply nodes). An exchange of information is formed between these nodes to synchronize all nodes (configurations and databases).

The main mechanism is an exchange mechanism with some distinctive and universal capabilities. The main difference is that the RIB exchange mechanism is more specialized and narrow, while universal exchanges provide the user with a wider range of opportunities.

Basic operating principles of RIB

It is possible to change the configuration structure only in the main root node of the distributed infobase. These changes are then propagated hierarchically to the subordinate nodes. Thus, this provides a single configuration structure space across all RIB nodes.

Data can be changed in any of the nodes, which in turn is distributed to all other nodes. Moreover, this data does not necessarily have to be transferred to other participants in the system and their complete identity may not be maintained. The developer can customize the composition of the data that participates in the exchange with other RIB participants as desired. Moreover, settings can be made not only at the configuration metadata level, but also at the level of individual elements, on which special selections can be applied.

As mentioned above, the RIB mechanism is achieved through the use of exchange plans. but in order for a particular plan to be used in this hierarchical structure, its “Distributed infobase” property must be activated.

All data is transmitted to the RIB via messages. The content of these messages is clearly regulated and cannot be arbitrary, as in the universal exchange mechanism. Data is placed in a message using the XML serialization principle. In addition to these data changes, the message also contains information about configuration changes, as well as a certain amount of service information. Changes are registered and placed in the exchange message completely automatically. Neither the user nor the developer can influence this.

Reception and generation of exchange messages in the RIB are set with one command

Exchange plans. WriteChanges(WriteMessages, 0)

The content is read using the command

Conclusion

We can safely say that the RIB mechanism mainly consists of a universal exchange mechanism with some distinctive features that are present only in the RIB structure.

The technology of distributed information bases (RIB) allows you to create a geographically distributed system based on 1C Enterprise configurations. This allows you to have a common information space even with those departments that do not have a reliable communication channel, combining high autonomy of nodes with the ability to quickly exchange information. In our articles we will look at the features and practical implementation of this mechanism on the 8.2 platform

First of all, let’s ask ourselves: why autoexchange? Modern technologies, combined with inexpensive and fast Internet, make it possible to organize remote work without any difficulties. The choice of methods is as wide as ever: RDP, thin and web clients, connecting networks using VPN - there is a lot to think about. However, all these methods have one significant drawback - a strong dependence on the quality of the communication channel.

Even with ideal operation of the local provider, it is impossible to guarantee 100% availability of the communication channel. Problems with the backbone provider, lack of power supply, physical damage to the communication line and many other factors make this task insurmountable. At the same time, the inaccessibility of the information base at a remote warehouse or retail store leads to quite significant losses. And finally, let’s not forget that there are places (for example, industrial zones on the outskirts of cities) where providing a high-quality communication channel is expensive and/or problematic.

The RIB mechanism allows you to get rid of these shortcomings; each department has its own copy of the information base with which you can work autonomously even in the complete absence of communication with the outside world. And the small amount of transmitted information allows you to use any communication channel, including the mobile Internet, for exchange.

RIB on platform 8.2 is not something fundamentally new, representing a further development of RIB platform 7.7, only now this technology has become more accessible and simpler. Unlike the RIB component, which had to be purchased separately, the RIB is an integral part of many standard configurations and works entirely in user mode, allowing you to do without the Configurator even at the setup stage.

At this point it would be time to move on to the practical part, but we will have to make one more digression. The fact is that the transition to the 8.2 platform, which seems to have already happened, in fact led to the emergence of two types of configurations: based on a managed application, “native” for the 8.2 platform, and adapted from 8.1, continuing to use outdated technologies and mechanisms. Since a significant part of the configurations (Enterprise Accounting, Payroll and HR Management) are adapted or transitional, they cannot be discounted, so the first part of our article will be devoted to these configurations (essentially the 8.1 platform), while in the second we will examine setting up auto-exchange for configurations based on a managed application (platform 8.2).

Let's consider a practical task: setting up automatic exchange via FTP for the Enterprise Accounting 2.0 configuration. Despite the fact that RIB allows you to exchange using email or file shares, we recommend using FTP as the simplest and most reliable method of communication. You can read how to set up your own FTP server, or you can use the FTP service of any hosting provider.

First of all, we need to configure exchange nodes. To do this, launch the configuration with administrator rights and select Transactions - Exchange Plans.

In the list that appears, select Full plan or By organization, if records are kept for several companies in one database and the exchange needs to be made only for one of them. In the window that opens, there is already one node - the central one, we need to edit it by indicating the code and name.

Then we will create another node for the branch, filling it in the same way (to add, click the green circle with a plus). The next step is to create an initial image for this node, which is a ready-made information base in file mode. To do this, right-click on the desired node and select from the drop-down list Create a starting image.

Now let's move on Service - Distributed Information Base (DIB) - Configure RIB nodes.

In the window that opens, click the button Add and configure a new exchange by specifying the remote host, exchange type (via FTP) and server connection parameters.

Bookmark Automatic exchange allows you to set up an exchange schedule, exchange by events (start and end of work, etc.), these settings are made for the user on whose behalf the exchange will be performed, so make sure he has rights to exchange data.

Don't forget to specify the node prefix for document numbering (otherwise you will receive different documents with the same numbers) in Tools - Program Settings; here you can also configure some other exchange parameters. On the same tab, you should select a user to perform exchange tasks; if you do not do this, the schedule will not work. Remember that the exchange will only be made if the user is logged into the program.

This completes the configuration of the central node; now you need to make similar settings for the peripheral node, connecting the initial image as an existing information security system. After which you can start exchanging data. To control you should use Communication monitor, it allows you not only to monitor the success of the upload/download, but also shows any collisions that have arisen or delayed movements (if the user who made the exchange does not have enough rights to perform any actions in the database). The presence of this tool allows you to quickly and effectively solve various types of problems that arise during autoexchange.

At this point, the exchange setup can be considered complete and you can begin working in distributed mode. It is worthwhile to dwell specifically on updating or making changes to the configuration. These actions are only available on the central node; all changes made will be automatically propagated to the peripheral nodes during the next exchange. To make changes automatically, the peripheral database must be in exclusive mode, otherwise you will need to run Configurator and execute Updating the Database Configuration manually.

A situation often arises when an organization has several branches or retail outlets geographically remote from each other. However, there remains a need to maintain consistent records throughout the organization. One of the options for solving this problem is to create a unified network, which will include automated workstations of all branches, and host the 1C information base on a public server. This method can be technically complex and expensive. In addition, a number of issues related to information security arise.

The second option is to create a distributed information base (RIB). A distributed information base is a hierarchical structure consisting of separate information bases on the 1C:Enterprise platform, between which data exchange is organized for the purpose of synchronizing configuration and data. These individual information bases are called RIB nodes.

A distributed information base can be created based on various configurations of the 1C:Enterprise system. Let's consider its creation using the example of 1C: Trade Management 10.3.

Let’s say an additional retail outlet is opened in a trading organization, where it is necessary to have access to the organization’s general trading system. To create a RIB you must complete the following steps:


This completes the creation of a distributed information base. To exchange information, you need to start data exchange in the Central database (changes that have occurred in it will be downloaded), then in the store (changes from the central database will be downloaded and changes that have occurred in the store will be downloaded), and again in the central database (changes will be downloaded into it , occurred in the store).

Distributed information bases have their own collision resolution mechanism. So, if during an exchange it turns out that any object (document, directory, etc.) has been changed in both the main and subordinate databases, then the change made in the main database will have priority.

If it is necessary to change the configuration of a distributed infobase, this must be done in the root node (see the first figure of the article), the configurations of the remaining nodes are locked. After making the necessary changes, they can be transferred to slave nodes using the standard procedure for exchanging data between RIB nodes. After the exchange is carried out in the configurator of the slave node, it is necessary to update the infobase configuration.

If you have problems setting up a distributed information base, our specialists will help you set up data exchange and explain in detail how to use it.

To create a distributed information base, you need to enter the program in 1C: Enterprise mode. To create distributed database nodes, select from the menu: Operations - Exchange plans. The “Select object: Exchange plan” window will open.


1. Consider the option with the “Full” exchange plan.

The exchange will be carried out across all organizations located in the distributed information base.

Let’s choose the “Full” exchange plan. The “Full Exchange Plan” window will open.

We fill out two entries:

Let's call the first entry “Main node”, indicate the code “GU”,

Let's call the second entry “Subordinate node”, indicate the code “PU”.

As we can see from the figure, the first entry has an icon with a green circle; this is the “Main Node” icon.


To create a copy of the “Main node” information base, click on “Slave node” and click on the “Create initial image” icon. This will be the “Subordinate Node” information base.


The “Creating an initial information security image” window will open, select “On this computer or on a computer on the local network”, click “Next”.


In the “Infobase Directory” field, select the location where the copy of the “Main Node” will be installed, and click “Finish”.


After creating the “Subordinate Node” infobase, the following message will appear:


Click “Ok”.

Add the “Subordinate Node” information base to “1C: Enterprise”. We go to the subordinate database in the "1C: Enterprise" mode. Let's open: Operations - Exchange Plans. The “Select object: Exchange plan” window will open. Let’s choose the “Full” exchange plan. The “Full Exchange Plan” window will open. We see that the “Main Node” icon is orange, which means that this node is the main node for the information base in which we are located.


We make the following settings in both the Master and Slave nodes:

1. Add a prefix for the distributed infobase.

This is done so that there are no conflicts in the numbers and codes of documents and directories created in two databases, so in each database we indicate a prefix that will be added to the document numbers and directory codes. Open: Tools - Program settings - “Data exchange” tab. In the “Node prefix for a distributed infobase:” field, enter “PU” in the subordinate database, and “GU” in the main database.


2. Add a setting for data exchange between nodes:

Open: Service - Distributed Information Base (DIB) - Configure RIB nodes. The “Data Exchange Settings” window will open.


Click “Add” and the “Data exchange settings” window will open. Enter the “Name” of your setting.


A node will automatically appear in the “Node” field, for the “Master node” there will be a “Slave node”, for the “Slave node” there will be a “Master node”.

In the “Directory” field, select the folder into which the exchange data will be sent; it is best to specify one directory for the main and slave databases.

In the “Exchange Type” field, we configure the transfer of data between databases: through a file or FTP resource. Let’s choose, for example, “sharing through a file resource.”

We do not change anything in the remaining fields.

Click “Ok”. We see that a setting has appeared.

3. To exchange data we do the following:

First, in the database in which the changes were made, click on the “Exchange according to the current setting” icon, as shown in the figure.


After uploading, the upload result window will appear.


Then, in the database to which you want to transfer the changes, click on the “Exchange according to the current setting” icon and the data will go to the database you want.

2. Consider the option with the “By organization” exchange plan.

The exchange will be carried out among selected organizations located in a distributed information base.

To create nodes of a distributed database, select from the menu: Operations - Exchange plans. The “Select object: Exchange plan” window will open.


Let’s choose the exchange plan “By organization”. The “Exchange Plan By Organization” window will open.

We fill out two entries:

Let’s call the first entry “Main Node”, indicate the code “GU”, we see the difference from the “Exchange Plan: Full”, a table has appeared in which we indicate the Organizations for which the exchange will take place.

Let's call the second entry “Subordinate node”, indicate the code “PU”, indicate the organization.


In all other respects, the setup is absolutely the same as with the “Exchange Plan: Full”.

Instructions for creating and configuring distributed databases using the URDB (URIB) component

The URDB (Distributed Database Management) component is used to exchange information between two identical 1C databases. If the configurations are different, then you can also use it, this is written in another. For the component to work, you must have the DistrDB.dll file in the BIN folder of the 1C: Enterprise program.

Let's look at the steps to create distributed databases. For example, we have a working base in the D:\base1 directory. It is required to make it central and create a peripheral base.

1. Create a directory D:\base2 for the peripheral database.

2. In the directories D:\base1 and D:\base2, create the folders CP and PC (use Latin letters).

3. Launch the central database configurator (D:\base1) and select Menu - Administration - Distributed Information Security - Management.

4. Click the “Central Information Security” button, in the window that appears, enter the code and name of the database. It is better to use numbers or Latin letters for the code. Enter, for example, 001 and “Central base”, confirm by pressing the “OK” button.

5. Click the "New peripheral information security" button to create a peripheral database. We enter the parameters for it: 002 and “Peripheral base 1”.

6. Use the cursor to select the “Peripheral base 1” base and press the “Setup” button. auto exchange". In the settings, change the manual mode to automatic. Be careful, this is important.

7. Using the cursor, select the “Peripheral base 1” database and press the “Upload data” button, then the “OK” button. As a result of the upload, the file D:\base1\CP\020.zip will appear.

8. Launch 1C in configurator mode, add a new database “Peripheral database 1” in the 1C launch window, specify the previously created directory D:\base2 for it.

9. Select Menu - Administration - Distributed Information Security - Management. To the question asked “The information base was not found. Do you want to load data?" Click the "Yes" button and specify the file name "D:\base1\CP\020.zip", click the "OK" button. After the download is complete, the process of creating a peripheral database can be considered complete.

In and also in the methods of creating a peripheral database by restoring a copy of the central database from a backup or attaching files of a copy of the central database for SQL format and executing the script are given. This will be useful for large volumes of data, when uploads and downloads take hours or are completely unrealistic.

Instructions for exchanging between distributed databases using the URDB (URIB) component

Let's consider a simplified example; we will perform the exchange manually by launching the configurator. You can use the batch mode of the configurator; you can use mail, ftp, and automatic file copying to deliver exchange packages.

To perform the exchange, you must select Menu - Administration - Distributed Information Security - Auto Exchange. If the exchange is automatic (see point 6 of the previous instructions), then everything will work out.

1. So, we change or create some objects that migrate to the peripheral database. Object migration rules are set on the "Migration" tab in the object properties (see the object tree in the configurator).

2. Launch the central database configurator, select Menu - Administration - Distributed Information Security - Auto Exchange, click the "Run" button.

3. Move the resulting file D:\base1\CP\020.zip to the folder D:\base2\CP\

4. We change some objects in the peripheral database. Preferably not those that were changed before in the central database, because the central database has priority for object changes during exchange.

5. Launch the peripheral database configurator, select Menu - Administration - Distributed Information Security - Auto Exchange, click the "Run" button.

6. As a result of the auto-exchange, we should have changes coming from the central database. We should also have a file to transfer to the central database D:\base2\PC\021.zip

7. Copy the file D:\base2\PC\021.zip to the folder D:\base1\PC

8. Repeat point 2. As a result, changes received from the peripheral database will appear in the central database.

So, the general principle of exchange: alternate execution of auto-exchange with simultaneous movement of files (exchange packages) from the PC folder of one database to the PC folder of another database and from the CP folder of one database to the CP folder of another database.

Configuration changes are made only in the central database. When changing the configuration, it is necessary to carry out the exchange in peripheral databases in exclusive mode. To successfully process packets from peripheral databases in the central database, the configuration must be loaded into the peripheral databases. If you get confused, it’s okay, the package rejected by the central database will be downloaded again.