| 1 | = Using the Mnesia database back-end = |
| 2 | |
| 3 | You do not need additional command line arguments, as this back-end currently the default. |
| 4 | After the system is installed, you can start RefactorErl with |
| 5 | {{{ |
| 6 | #!sh |
| 7 | |
| 8 | bin/referl |
| 9 | }}} |
| 10 | |
| 11 | Alternatively, you can specify the database manually by typing |
| 12 | |
| 13 | {{{ |
| 14 | #!sh |
| 15 | |
| 16 | bin/referl -db mnesia |
| 17 | }}} |
| 18 | |
| 19 | Mnesia uses the RefactorErl data directory to store its data. You can specify it by typing |
| 20 | |
| 21 | {{{ |
| 22 | #!sh |
| 23 | |
| 24 | bin/referl -dir /path/to/your/data/dir |
| 25 | }}} |
| 26 | |
| 27 | Note that if you would like to start several instances of !RefactorErl/Mnesia, |
| 28 | you currently have to specify different paths for the instances, |
| 29 | as Mnesia stores the name of the node in the database. |
| 30 | Obviously, you have to choose different node names as well. |
| 31 | |
| 32 | {{{ |
| 33 | #!sh |
| 34 | |
| 35 | bin/referl -sname name1 -dir /path/to/your/data/dir1 |
| 36 | bin/referl -sname name2 -dir /path/to/your/data/dir2 |
| 37 | |
| 38 | # or |
| 39 | |
| 40 | bin/referl -name name1 -dir /path/to/your/data/dir1 |
| 41 | bin/referl -name name2 -dir /path/to/your/data/dir2 |
| 42 | }}} |
| 43 | |
| 44 | After the system is started, the following operations work on the full database. |
| 45 | |
| 46 | {{{ |
| 47 | % Clear the whole database. |
| 48 | ri:reset(). |
| 49 | |
| 50 | % Make a checkpoint. |
| 51 | ri:backup(). |
| 52 | |
| 53 | % Undo all changes made since the last backup. |
| 54 | ri:undo(). |
| 55 | }}} |
| 56 | |
| 57 | You can also use all [[SemanticQuery|querying]] and [[RefactoringSteps|refactoring functionalities]]. |
| 58 | |
| 59 | = Comparison with the NIF back-end = |
| 60 | |
| 61 | Note that while the Mnesia back-end has been under development longer and can be expected to be more stable, |
| 62 | it is much slower than the [[NifDB|NIF based back-end]]; |
| 63 | you can expect about an order of magnitude of speed-up. |
| 64 | Also, the NIF back-end may require less storage. |
| 65 | 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. |