Main Menu

KB#00984-Enhancing Your Data Server Configuration

Title:

Enhancing Your Data Server Configuration

Description:

Configuring the PRO/5 Data Server 

Most of the information you will need to configure the Data Server can be found in the Data Server Manual in the Configuration and Command Line Syntax chapter. A common question we get about accessing data via the Data Server is regarding the use of PREFIXes with the Data Server and Client. This is an important consideration when setting up the Data Server, because a well thought out design plan can make or break the deployment of an application. This section covers the different ways to access a Data Server, with and without using a PREFIX. 

The most efficient access to a Data Server is to use an explicit path and file name (e.g., /<BASIS>/u/accounting/general/ledger.1) just as the most efficient way to access a file on any system is to be explicit. In the above example, the only place the file ledger.1 is looked for is the path specified. If it isn't in that location an error is returned. If you specify a hard-coded path like the one above and a decision is made to move the data residing in /<BASIS>/u/accounting/general/ to a different computer, then you must check all the programs that reference the files moved and update them. This can take a very long time and leaves room for error. If you miss just one line of code referencing any of these files, you will have a problem. When that program attempts to open the file and cannot find it, an error is issued causing work to stop until the code is fixed. Needless to say, no one wants this to happen. 

If you define and use prefixes in both the client and the Data Server configuration files you can avoid this kind of problem easily. There is a time factor cost associated with using a PREFIX, but if it will be so minor your users will never notice. The time lost searching for a line of code to change can certainly be far greater. Using a PREFIX takes a little more time to process requests because the Data Server searches directories based on the PREFIX instead of going directly to the sub-directory. 

To use a PREFIX on the Data Server, specify the path(s) in the configuration file of the Data Server (config.bbx, by default). Once the Data Server is started, the only way to change the PREFIX is to change the configuration file, stop the Data Server, then restart it. If you must do this in the middle of a workday, you must ensure that there are no users accessing data via the Data Server first or you may end up with corrupted files. However, the amount of time required to stop and restart the Data Server is small enough (one or two minutes), that you may be able to do it during lunch while nobody is accessing the Data Server. 

The PREFIX for the Data Server should reflect the location of all the files to be accessed on that computer. For example, you have data files in the directory /u/account/general/, and your program files are in the directory /u/account/programs/. You know that when deployed the data files will be accessed more often than the program files via the Data Server. So, the best way to set up your prefix line in the configuration file would be to have it search the data file directory first, then the program directory second. Thus, your config.bbx file would have the line: 
        PREFIX /u/account/general/ /u/account/programs/ 
If you ever want to change the directory structure above, it is quick and easy. The new structure of the data files only will be: /u/account/general/, /u/account/receivables/, and /u/account/payables/. Instead of going through a search and replace exercise on the programs and files related to this application, you only need to edit the Data Server configuration file. The new config.bbx would have the line: 
        PREFIX /u/account/general/ /u/account/payables/ /u/account/receivables/ /u/account/programs/ 

Configuring the Client Workstations 
If you have the Data Server configuration set up as shown above, configuring the clients that will access these files is equally simple. The prefix on the client is simply: 
        PREFIX /<BASIS> 
where BASIS is the name of the host server. 

You can also move the files from one server to another easily. This is best described in an example, so we will use the above configuration. Let's say the data files must be moved to another host server (<BASIS1>), but you want to leave the program files where they are (on <BASIS>). The directory structure will stay the same with /general/, /payables/, and /receivables/ as subdirectories. If the location was hard-coded in your programs you would have to go through all the programs and determine which lines of code need to be changed. By using the prefix alternative, you simply need to change the prefix in the configuration files for <BASIS>, <BASIS1>, and the client. The new Data Server prefix line for <BASIS> would be: 
        PREFIX /u/account/programs/ 
The new Data Server prefix line for <BASIS1> would be: 
        PREFIX /u/account/general/ /u/account/receivables/ /u/account/payables/ 
and the client's new prefix would be: 
        PREFIX /<BASIS1> /<BASIS> 

If you have the PRO/5 Data Server for Windows NT and you want to limit the access to the data files by department, this can be done on the Client's workstation easily. In the configuration file of the Data Server you can use DSKSYN's to deny access to certain users. If you don't want a user to see only the data files that reside in the /u/account/receivables/, you can eliminate their access by adding another line to the client config.bbx that reads: 
        DSKSYN /<BASIS1>/u/account/receivables/ 
The user will have complete access to the files in the /general/ and the /payables/ subdirectories. This is specific to the PRO/5 Data Server for Windows NT and can be quite useful in high security environments. 

The use of the PREFIX in configuration files on the Server and the Client can simplify your work if you ever need to move files. This is an important consideration when creating an application for deployment and can save you time and headaches. If you do not anticipate ever moving the files, then you may choose to increase the efficiency of the Data Server by specifying explicit paths in the programs. It is left up to you to decide what works best for your situation. 



Last Modified: 06/21/2005 Product: PRO/5 Data Server Operating System: All platforms

BASIS structures five components of their technology into the BBx Generations.

  Google+ View BASIS LinkedIN ProfileVisit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel