Work Shopdesk with primary and backup databases

Автор:   Мукан Андрей, mukan@andriy.co

Starting with version 4.0, Shopdesk become an important feature. Now he can operate autonomously, without requiring a permanent connection to the database. And indeed, why not use the good old favorite with users Shopdesk on those jobs that do not have a permanent connection to the main database of its accounting system? And even more - in the workplace, which generally have no connection either to the local network, being geographically remote from the server with the database or the Internet, which as you know, erasing boundaries and reduces the distance? Even in spite of negligible traffic consumed Shopdesk-th and the almost total indifference on his part to bandwidth Internet connections, it (the connection) is still needed to work Shopdesk. Well, in our time to organize remote connections with the World Wide Web poses no problem. You can communicate even in the field ", using the available GPRS, EDGE, or other communication technologies. It would seem - Plug & Play. However, this cheerful picture always overshadowed a "but". And this "but" the strength to erase all of your plans for the organization of the endpoint with the main database accounting system. "But" it always does, sooner or later. The connection can be stopped. Let us now delve into the reasons why this may happen. The reasons may be very different - from the banal wire breakage telephone line on the side of the subscriber (which happens often enough) to problems on the side of the Internet service provider (which happens much less often, but it happens). Moreover, the problems with database connection is not insured, even local network. Finally, problems can happen to own a server database - Equipment can fail at the most inopportune moment. Closing the database connection even for a short time would jeopardize the performance shop. Over the long absence of a connection becomes a disaster and causes complete paralysis in servicing clients. About the rush hour even to mention scary. Therefore, the solution in which the connection of remote stores was carried out exactly by using an Internet connection, it was impossible to recognize successful because of the largest and the main problem - the unreliability of the physical connection between the client (the cashier's workplace) and server (database server MSSQL).

Specialists SoftKB always paid attention to customers on this issue in the organization of remote workstations connecting cashier. Typically, in such cases they offered another our product - "Shopdesk Remote". This application, which is analogous Shopdesk, but having the ability to work offline (only). However, for some time now it is inferior in functionality and usability of the core products that provide full organization of the work of the cashier's workplace - Shopdesk. Well, time has come. We took the best of both projects, and now present to you the updated Shopdesk, having the opportunity to work with the database as online (with direct connection to the database of the main accounting system), and in the off-line (with no connection to the main database or with intermittent connectivity). It should be stressed - this decision increases the "survivability" of the system as a whole. Using it, even in local networks where you are sure of the compounds of jobs to the server, you still provides more reliable operation of your frontofisnyh systems, eliminating the influence of communication problems and even failure of the servers on the performance of jobs of cashiers. If you have problems with communication jobs cashiers can work independently to troubleshoot. In addition, administrators now have the opportunity to disable a database server for routine preventive maintenance work on or replacement of equipment, while not breaking performance shop. Previously, such work could be conducted only at night.

Tell me more about how it works. Shopdesk has 3 of the most important mode of the database:

  • mode with the main database (ONLINE mode). In this mode Shopdesk working exclusively with the main database (requires a direct connection to the main database). If there is no connection to the main database or, if his recovery after breaking Shopdesk discontinued. This mode of operation is completely similar to the regime of Shopdesk to version 4.0
  • mode with a backup database (OFFLINE mode). In this mode Shopdesk works exclusively with a backup database (backup database must be pre-created one of the methods described below). If there is no backup of the database Shopdesk offers switch mode with the main database.
  • Auto mode (Automatic mode). When you run Shopdesk has attempted to connect to the main database. If you can Shopdesk continues to work with the main database for the entire session (ONLINE mode), before the possible termination to connect to the main database. Failing to connect to the main database, Shopdesk passes to connect to the standby database (OFFLINE mode). In the same mode Shopdesk passes in the case of breaking the connection to the main database. In the case of the operation to a backup database, this regime persists until the end of your session Shopdesk.

Algorithms for selecting a database connection

algorithm of choice to connect to databases, depending on the chosen mode of Shopdesk startup is shown in Fig. 1.

Algorithm for selecting a database when you open Shopdesk under the regime of

Fig. 1. An algorithm for selecting a database when you open Shopdesk under the regime of.

algorithm works with connections to the database depending on the selected mode Shopdesk with disconnection from the main database is shown in Fig. 2.

An algorithm for selecting a database when a disconnection from the main database

Fig. 2. An algorithm for selecting a database when a disconnection from the main database.

As you can see, algorithms for choosing a database fairly simple, and as they say, intuitive. It remains to add that the backup database - a file in MS Access named offlineDB.mdb, located in a local folder with the program Shopdesk, in a subfolder offline (eg, C:\Program Files\SoftKB\Shopdesk\offline).

Another important feature - while running in OFFLINE mode, the application also uses the local folder Shopdesk\offline\GRR\to save the files, checks. It is understood that when there is no connection with the underlying database, there is no network folder for the export file, checks with the extension grr (details on these files and exchange them with the trading server tzu can be found in reference to the program Shopdesk). These files can be sent by regular means Shopdesk for processing trading server tzu or any other means convenient system administrator account, until the transfer of their e-mail or by moving to the magnetic and electronic media.

switching modes Shopdesk

Open the menu Shopdesk "Settings" - "Manage connections to the database and set the desired mode Shopdesk. The choice will affect the algorithm for connecting to databases.

Forma control connections to BD

Fig. 3. Form of government connections to the database.

Create a backup of the database

Let us consider options for a backup database. Of course, if no connection to the main database for the application needed backup database. It is called "backup" just because it is used in cases where there is no substantive basis. In fact, ideally, Shopdesk should always work with the main base accounting system, since it in real time to reflect all the changes occurring as a result of actions of cashiers, operators, storekeepers on consumption and the arrival of goods, change their prices and quantities. And use the backup database immediately returns us to the "frozen" state credential. These data correspond to the time that created this backup database. With the intensive work with the database, any backup becomes obsolete immediately after changing any data in the main. It's like buying a new car - he is new, yet not left the gate motor show. Therefore, the administrator account is required to maintain the system at an adequate level of urgency backup database. Choosing the frequency of updating it entirely rests with the administrator and is determined, ultimately, factors such as the frequency of revaluation of the goods. The coincidence of the retail price of any commodity in the back and in the main database should always be complete, all 100%. Using a backup of the database - it is always a compromise between the relevance of accounting data and capacity for work, as such, the cashier's workplace. Or RMK works, but in the absence of due attention to the frequency of updating the database backup, supply goods at a price different from the actual at the current time, or the PMK did not work at all and you lose your customers.

Create (or update) a backup database can be in several ways:

  1. from the connected master database of any kind - or MS Access, or MS SQL.
  2. from a backup (archive) copies of the database tzu (files *. tcubk). Only database tzu format MS Access.
  3. physical (in the file system) copy the database tzu format MS Access tcu_be.mdb from catalog to catalog tzu Shopdesk, in the offline\offlineDB.mdb.

third method allows the administrator to creatively about upgrading backup database. For example, if work is done on a local network, you can implement planned regular updates automatically. Or to dispatch the main database by e-mail, and on the client side to automatically retrieve it from the letters and keep in off-line catalog. The first two methods are carried out by regular means of application and will be described further.

Open the menu Shopdesk "Settings" - "Manage connections to the database"

Forma control connections to BD

Fig. 4. Form of government connections to the database.

button № 1 "Create a database for back-connect creates a database from a backup connection to the core. At the local drive, offline folder directory Shopdesk, on the basis of the standard creates an empty database, which copies all needed to work Shopdesk data. The sample data is based on what outlets serving Shopdesk. So be careful - after editing the list of available outlets in the settings Shopdesk be sure to update the backup database. As copied data - the operation takes place fairly quickly even on slow Internet connections. For example, the bandwidth 256 Kbps backup database with the registry remnants of 3000 kinds of goods created in about 1 minute (the main database is located on a remote MSSQL server). The volume of data transmitted in this case is about 500-600 kb.

button number 2 "Create a backup of the database from the archive database tzu" creates a backup of the database from the archive file extension "tcubk". This file is created in the pre-tzu, with the menu "Backup database". The file is a database in MS Access format with a file name extension.

Arhivirovanie database TTSU

Fig. 5. Archiving database Tzu-3.

resulting archive database, you can send e-mail, or the complete absence of Internet access, move to the cashier's workplace in an electronic medium. When you create a backup database from the archive database is copying a file archive in offline folder Shopdesk while renaming the file - offline\offlineDB.mdb. Then when you select Shopdesk Offline or Automatic can work with a backup database.

Annex Shopdesk has developed a message system, and in situations of violation of connections, as well as the transition from one mode to another, will notify the user (cashier), recalled undelegated for processing trading server files, checks, automatically attempt to restore the connection to the remote database, etc. Current mode Shopdesk-as can be seen in the status bar - green light indicates the work to the main database (online subscription), red - to work with the backup database (offline connection).

Tekuschy mode Shopdesk with base dannyh

Fig. 6. Current mode Shopdesk database.

In conclusion, it remains to add - do not forget to maintain the relevance of a backup database to an acceptable level for you!

Note: This article was obtained through a machine translation. We would appreciate any comments.

Статья включена в следующие темы:

Вверх