Skip to content

Commit

Permalink
Added persistence config to README
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan770 authored Nov 5, 2020
1 parent 93d46b9 commit 313360f
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,30 @@ cargo build --release
### Spartan.toml keys

* `queues` - Array of queue names (required).
* `path` - Database path (default: `./db`).
* `body_size` - Max body size in bytes (default: 32 Kb)
* `persistence_timer` - Amount of seconds between each database write to disk (default: `900`).
* `body_size` - Max body size in bytes (default: 32 Kb).
* `gc_timer` - Amount of seconds between each GC job wake (GC cycle times vary, default: `300`).
* `persistence` - Persistence configuration for both log and snapshot drivers.
* `access_keys` - Table of queue access keys. Anonymous access to queues will not be permitted if this key has any value.
* `replication` - Replication configuration for both primary and replica nodes.

#### `persistence`
There are two available persistence drivers, that Spartan supports - `log` and `snapshot`.

| | `log` | `snapshot` |
|--------------------|-------|--------------------|
| Performance | - | + |
| Small disk usage | - | + |
| Reliability | + | - |
| Compaction support | + | Always compacted |

By default, after executing `spartan init` command you'll receive config with `snapshot` driver, which is an optimal variant for most cases.

Both drivers support these configuration keys:
* `mode` - Persistence mode (default: `snapshot`).
* `path` - Database path (default: `./db`).
* `timer` - Timer between each queue persistence cycle for `snapshot` driver, and replication storage persistence cycle for `log` (default: 900 seconds).
* `compaction` - Enable `log` driver compaction on Spartan startup (default: true).

#### `access_keys`
Spartan has authentication and authorization mechanism using access keys.

Expand Down

0 comments on commit 313360f

Please sign in to comment.