Mounting a database file
Starkits differ from other packaging schemes in that they present themselves as a "file system inside a file" to the application.
The magic for this is provided by Tcl's Virtual File System (VFS), which is part of the core as of Tcl version 8.4.
Benefits are:
- applications can run either unpacked or from a starkit file with almost no difference
- application development is unchanged, the file system model can be used for all storage and scripts
- when deployed, such single files form a nicely self-consistent and robust package
- starkits are slightly harder to tamper with or accidentally damage than multiple files
- the default is to store files in a compact, zlib-compressed, form
But in the case of starkits, which are based on the Metakit embedded database package, there are a few more benefits:
- files can be opened in read/write mode, allowing applications to modify themselves
- because Metakit supports transactions, changes are robust, even across power failures
- starkits can store configuration data inside themselves
- starkits can store large amounts of data, i.e. entire complex documents
- starkits can update themselves safely