English Français Deutsch Italiano Dansk Español

Sofa DB

The Sofa DB is a database without predefined fields.

All records are saved as files. Each creation or change of a record creates a new file with a unique revison number.

Each record is a textfile. The file can have fields with the Semantic MediaWiki syntax: [[field::value]]

The field name must start with a letter and can have letters, numbers and underscores, but no whitespace. Field names starting with an underscore are reserved for the DB.

The sofa DB can be searched with queries that apply to the entire content or to the defined fields. You have a console Special:Fields, and you can embed searches directly in a page with the query function.

Internals

The files are stored in the revisions folder with the name of the revision and the .txt extension.

The files are self-contained: At any moment, the index can be recreated by parsing the files.

Each files contains the content of the record preceeeded by a small header containing internal fields: _revision, _name, _user, _timestamp, _status. The header is separated from the content with a special empty field [[_ ]]

The saved files in the revisions folder are never touched any more.

For performance, the DB creates indexes in the indexes, saves searches and a serialized wiki object is also written to the current folder. It is written each time a page is modified. The filename is an md5 footprint of the page name. A serialized object is also written with the revision number as filename.

As the files are self-contained so you can throw the indexes, they will be rebuilt. The files in the current folder are created on editing, but can be retrieved from the revisions folder if they are not available.

Reset the Indexes

Go to Special:Indexes.

  1. Reset All,
  2. Rebuild Indexes
  3. Reset Bitmaps
  4. Index Names
  5. Index Bloomn
  6. Index Fields
  7. Reset Bitmaps

If you have many pages, you may need to call several times one step before going to the next one.