I can't understand why separate write and read is better than write and read in one server.
For example, I have a mysql cluster with three machines: node1, node2,node3.
One possible architecture is:
- All write requests to node1, but all read requests to node2 and node3.
The second possible architecture is:
- All of these three nodes handle both writes and reads.
We can see in architecture one that the write to node1 pressure very huge, so I prefer architecture two.
Also, why does mongodb separates writes to primary node and reads to secondary nodes.
SlaveOK
or another read preference. By default the primary will handle both reads and writes. - Andre de Freremongod
andmongos
are viable strategies depending on the case. Check here and here for more details. - Andre de Frere