SoftInstigate / restheart

Rapid API Development with MongoDB
https://restheart.org
GNU Affero General Public License v3.0
807 stars 171 forks source link

Questions about MongoDB Cluster config and Read-Write separation #357

Closed StevenJSun closed 5 years ago

StevenJSun commented 5 years ago

We have some questions about restheart config: 1、How to config mongodb cluster(Replica Set) in default.properties for restheart? 2、How to config Read& Write Separation in Restheart cluster and MongoDB Replica set. 3、Could I set readConcern and writeConcern Options in MongoURI ?

Environment

MongoDB 4..0.6 RestHeart 4.0.0

ujibang commented 5 years ago

1) This is a mongodb configuration (not restheart). check https://docs.mongodb.com/manual/reference/replica-configuration/

From the perspective of a client application, whether a MongoDB instance is running as a single server (i.e. “standalone”) or a replica set is transparent.

2) I don't understand the question. can you please clarify it?

3) yes

StevenJSun commented 5 years ago

@ujibang thanks your answer to the 1st and 3rd questions , and the second question is : We want the read requests executed in part of cluster nodes, and write requests are also executed in part of cluster nodes. the read and write requests are exeucted in different nodes. So, are there any advice or best practices about Restheart and MongoDB ?

ujibang commented 5 years ago

@StevenJSun you can have two instances of restheart configured with different read and write preferences and then use a reverse proxy to forward GET and write requests to one or the other.