NoBrainerORM / nobrainer

Ruby ORM for RethinkDB
http://nobrainer.io/
Other
387 stars 49 forks source link

Which rethinkdb_urls should I use for a 3 shard/2 replica architecture #195

Closed jacksonConrad closed 8 years ago

jacksonConrad commented 8 years ago

The docs say:

rethinkdb_urls specifies the RethinkDB database connection urls. You may specify multiple urls to provide fault tolerance capabilities.

Should these urls correspond to only the primary replicas for each shard? Is there anything to be gained by including the secondary replicas?

nviennot commented 8 years ago

My understanding is that secondaries reroute queries to primaries unless read_mode is set to outdated (https://www.rethinkdb.com/api/ruby/run/). So unless you are using outdated reads, then I would think there's nothing to be gain to include secondaries in the rethinkdb_urls.

jacksonConrad commented 8 years ago

Thank you. As a follow-up question:

If I wanted to run a rethinkdb proxy node on my application server, would I simply omit config.rethinkdb_urls entirely, since NoBrainer picks localhost as the default database connection? Is there any other config required for using a rethinkdb proxy node?

nviennot commented 8 years ago

there's not difference in nobrainer configuration between a proxy node or a regular one.