Review Foundry Review Engine User Manual

CONFIGURATION -- MySQL Server

Adjust Text:  a a a a
« Table of Contents   |   Obtain Review Foundry »


CONFIGURATION

MySQL Server

Review Foundry was designed with the MySQL Server in mind, and presently this is the only database server that has been tested with the application. This may change in the future, but for now you will need MySQL installed on your server in order to use the program. Discussed here are the (relatively) few variables that must be specified in order for the program to be able to connect to your MySQL server. These variables are requested by the installer script, but are also accessible via the MySQL Server frame of the Configure control panel. These MySQL variables are stored in the /my/defs/database.def file:

  • db_host
    Example: localhost
    This is the name of the MySQL database server, and often this is simply just localhost, but may be something like mysql.mydomain.com (ask your web host about this if you are unsure).
  • db_name
    Example: redqueeen
    This is the name of the database in which your Review Foundry tables were created.
  • db_username
    This is the username your web host has provided you for database connections.
  • db_password
    This is the password your web host has provided you for database connections.
  • tb_prefix
    Example: rq_
    This is the prefix used to distinguish all Review Foundry tables from any other tables you may have created in the database in which the Review Foundry tables are found. It is always a good idea to use a prefix so that, if you need to in the future, you can add tables for another application without fear of the table names clashing.
  • tb_hashing_depth
    Example: 3
    This variable is not directly related to your MySQL Server, but it does belong here with the others as it relates to the way in which uploaded files are stored. Each such file is logged in the Upload table, but the file itself is NOT stored as a BLOB database field. Instead it is stored within your server's file system. Where exactly depends upon whether the corresponding upload file column is of the PUBLIC or PRIVATE variety (PRIVATE files are not directly accessible from your document root, while PUBLIC files are). Actually, when you attempt to add an upload file column to a table, you will discover that there are 4 types of upload file to choose from: PUBLIC_FILE, PRIVATE_FILE, PUBLIC_IMAGE, PRIVATE_IMAGE. The latter 2 types are especially handled so that they may be viewed rather than downloaded when accessed.

    If you plan to use the file upload feature to attach files to database records, the "hashing depth" parameter is worth understanding, particularly if you plan to add a large number of upload files to your tables.

    Each uploaded file is generally stored in a unique directory. The top directory name mirrors the database name, the next directory is named after the table, followed by the column, and finally a series of one-character subdirectories are obtained by parsing a unique string character by character. For example:

    /upload/databasename/Item/reptile_image/d/5/w/3/frog.gif

    This naming structure allows a large number of files to be stored with quick access times, and also allows branches to be located manually, when necessary. Here, the above utilized 'd5w3' string would be obtained by MD5 hashing the PRIMARY KEY for the 'Item' table record with the file name and then using the first N = 4 characters to arrive at the subdirectory where the file will be stored. N is the table hashing depth. Because each of the hashed subdirectories is chosen from the set [a-z0-9] the number of unique subdirectories for a given hashing depth is 36^N. So a hashing depth of 4 corresponds to about 1.7 * 10^6 unique subdirectories. You might want to get by with N = 3, or you might want to increase N (though it would seem unlikely you would need to do so).

    The default (recommended) hashing depth is N = 4.

    Note that, if needed, you can change the hashing depth at any time. Each record carries with it the value of the hashing depth used when the first file for that record was uploaded. That value will continue to be used for the life of the record. New records will use the hashing depth currently specified in your database.def file.

  • db_port
    Example: 1000
    Rarely will you be required to supply a port number in order to connect to your database host. But if this is required your web host will alert you to the fact.
  • db_socket
    Example: /mysql/socket_file
    Again, rarely will you be required to supply the path to a socket file in order to connect to your database host.

If you need to change the backend database that Review Foundry uses you can do so by specifying the corresponding variables for the new database from the MySQL Server frame of the Configure control panel. Note, however, that the new database must exist and have been populated with Review Foundry tables in order of the new database to be recognized and for the update take place. If you first need to create a new Review Foundry database, use the installation script--jump to the Step responsible for setting up tables, perform only that action, and return to your MySQL Server frame to complete the database swap.

« Table of Contents   |   Obtain Review Foundry »


Copyright © 2004 Random Mouse Software. All Rights Reserved.