new Replica(manager, colls, opts)
Constructor for the Replica class.
Replica sets are used just like regular data collections. Please see Provider for usage reference.
Options:
master
{string} - Defines the master collection in the replica set. If omitted the first collection in the set is assumed to be the master.readStrategy
{string} - Defines the read strategy for the replica set. See Replica#readStrategy.writeStrategy
{string} - Defines the write strategy for the replica set. See Replica#writeStrategy.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
manager |
Manager | An EntreeJS instance. |
|
colls |
string[] | The names of the data collections participating in the replica set. There must be at least two collections in the array. |
|
opts |
object |
<optional> |
Additional options. |
- Source:
Members
-
collections
-
An array of the names of the data collections participating in the replica set.
- Source:
-
manager
-
The EntreJS instance holding this replica set.
- Source:
-
master
-
Defines the master collection in the replica set. If omitted the first collection in the set is assumed to be the master.
- Source:
-
readStrategy
-
Defines the read strategy for the replica set. Defaults to
master
."master"
- Only the master collection is used for read operations (e.g. get, select)."round-robin"
- All collections in the set are cycled for ever read request."feedback"
(not available yet) - Collections with lower latency are given higher priority.
Read strategy allows for simple load and throughput balancing of back-end services.
- Source:
-
writeStrategy
-
Defines the write strategy for the replica set. Defaults to
rollback
."rollback"
- Attempts to recover the state of all collections in case any of them fails to write successfully."none"
- Errors on failures are returned but no actions are taken.
- Source: