Virtual File System

Virtual File System usually refers database-based file system used in content management systems.

Structure
General difference between regular file system and the virtual file system is that file nor it's content does not exists psychically as a file in the hard disk as it does in regular file system. In virtual file system name of the file as well as it's contents are located in the database where all information is read.

Normally when internet user's browser makes a web-request (i.e. user browses a web-site) web-server reads the local server's mass-storage system (usually harddisk) and seeks for existence of the requested file (if none specified, this usually means index.html). If one exists, web-server reads the file and displays it to the user.

In virtual file system when user makes a web-request, request is redirected to the different handler than the regular file system (usually made with .htaccess file in many CMS:s) which then scans the database for the requested file. If the requested file exists in database and is accessible (it is not prevented by security levels or any other similar restriction methods) handler sends it's contents.

Implementation
Virtual File System always needs two basic things:


 * Code / coding enviroment

A Request and data (as well as database) handler made with a certain programming language, usually a PHP or a PERL. The creator of the CMS has created process with this coding language to handle the requests and process them with the wanted method. Handler usually communicates with database (server) and exchange data between the users of the site and the database through handler.


 * Database

A Storage for masses of data. Database is a (usually large) structure of the data, structed many times same way as the common spreadsheet application with multiple tables. Database contains many tables which serve several different purposes such as file-system table which contains all information of the file structure in server.

Regular VS. Virtual
Here is the small review of the common goods and bads in the virtual file system.

Why it is a better than regular file system?


 * One system control all files: There is no need to make changes on multiple files on every critical system change
 * Fast changes: If system uses templates, you usually can change the whole site easily without needing to make changes for each file different (as in regular file system)
 * Security: File handler define all system security and can be easily changed
 * Protection: Files cannot be accidentally deleted with the FTP or by the Cron-jobs
 * Speed: VFS is usually much faster than regular FS
 * Easy adminstrating: All administration services can be built over web-interface, no need for FTP or Shell
 * Can be backed up easily because everything is located in one certain place (database)
 * Can be made to perform more complex tasks than regular file system and more easily
 * Shared components: Inclusion of the critical and non-critical can be made easily to the VFS
 * More expandable and can contain (CMS-)specified scripting language

Why it is a worse than regular file system?


 * All data is located in a single place: In case of a system crash or by poor security coding: Database can be hacked or broken causing all file-data to be lost.
 * Single file cannot be backed up easily with file transfer systems.
 * Some VFSs do not support as native process tasks (perl) as the regular file system
 * Creating one needs good knowledge of the database and the coding language
 * One bug affects all files when in regular bug is usually restricted to the single file only

Example VFSs

 * MediaWiki (this one)
 * WordPress
 * VRMD - Virtual Document Format
 * VMFS - Varjomedia File System