Changes between Initial Version and Version 1 of NifDB


Ignore:
Timestamp:
Feb 23, 2012, 3:59:44 PM (13 years ago)
Author:
manualwiki
Comment:

NifDB created

Legend:

Unmodified
Added
Removed
Modified
  • NifDB

    v1 v1  
     1= Using the NIF database back-end = 
     2 
     3Currently, the Mnesia based back-end is the default, 
     4therefore you have to specify a command line argument if you would like to use the NIF based back-end. 
     5 
     6After the system is installed, start !RefactorErl with 
     7{{{ 
     8#!sh 
     9 
     10bin/referl -db nif 
     11}}} 
     12 
     13NIF uses the !RefactorErl data directory to store its data. You can specify it by typing 
     14{{{ 
     15#!sh 
     16 
     17bin/referl -db nif -dir /path/to/your/data/dir 
     18}}} 
     19 
     20If you would like to start several instances of !RefactorErl/NIF, 
     21you have to choose different node names. 
     22It is also suggested to set different data directories as well, 
     23although it is not strictly required. 
     24{{{ 
     25#!sh 
     26 
     27bin/referl -db nif -sname name1 -dir /path/to/your/data/dir1 
     28bin/referl -db nif -sname name2 -dir /path/to/your/data/dir2 
     29 
     30# or 
     31 
     32bin/referl -db nif -name name1 -dir /path/to/your/data/dir1 
     33bin/referl -db nif -name name2 -dir /path/to/your/data/dir2 
     34}}} 
     35 
     36After the system is started, the following operations work on the full database. 
     37 
     38{{{ 
     39% Clear the whole database. 
     40ri:reset(). 
     41 
     42% Make a checkpoint. 
     43% This operation is always executed after transformations 
     44% and file operations (e.g. adding or dropping a file). 
     45ri:backup(). 
     46 
     47% Make a checkpoint with a commit log message. 
     48ri:backup(CommitLogMsg). 
     49 
     50% Lists all backups. 
     51ri:ls_backups(). 
     52 
     53% Undo all changes made since the last backup. 
     54ri:undo(). 
     55 
     56% Removes all backups. 
     57ri:clean(). 
     58}}} 
     59 
     60You can also use all [[SemanticQuery|querying]] and [[RefactoringSteps|refactoring functionalities]]. 
     61 
     62= Comparison with the Mnesia back-end = 
     63 
     64While the [[MnesiaDB|Mnesia]] back-end has been under development longer and can be expected to be more stable, 
     65it is much slower than the NIF based back-end; 
     66you can expect about an order of magnitude of speed-up. 
     67Also, the NIF back-end may require less storage. 
     68As an indication, loading ejabberd-2.1.8 (6.6 MB on disk) takes '''18323 sec''' and '''566 MB''' of RAM and '''66 MB''' of disk space, while the NIF back-end on the same machine takes '''458 sec''' and '''556 MB''' of RAM and '''52 MB''' of disk space.