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