Types of files to be released

One issue that I have seen come up again and again in badly conceived projects is the mixing of files that should have been properly partitioned when the distributions were created. One very simple example is that log files are created in the application's root directory. This makes it more difficult for various utilities and system maintenance routines to operate as well as for upgrades within the release engineering framework.

I have divided files in the application into four possible types:
  • program - binary executables, shell scripts and library files. A library file is code that is being used by another program, but is not executed directory.
  • configuration - files that define values specific to this installation, e.g. db source, appl dir, peer hosts, etc.
  • persistent - files that would need to survive upgrades and/or backups, e.g. databases
  • transient - files that are created for temporary use, e.g. log files, caches
Each of these types of files should be separated into different directory trees and should not be mixed. With proper design, this should be easy to achieve.

Program and configuration files could be set to read-only by the install program; configuration files changed to read-write as needed. The directories for the persistent and transient files should be read-write for the owner of the application and any other application that needs access.

With this simple separation, upgrades and upgrade programs can be made much more easily. Backups can be tailored as needed. And the application's release structure is similar to its memory structure: program code separated from data, separated from heap, separated from kernel, etc.

No comments: