[JAVA-149] Allow option to read from slaves from replication set and write to master only Created: 20/Aug/10  Updated: 30/Aug/10  Resolved: 29/Aug/10

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: 2.1
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Joseph Wang Assignee: Eliot Horowitz (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The issue is we have massive update written to master. We want to have fast response for read. It will be nice to have a way to specify that read options should only go to slaves and writes only go to master within the replication set.

From: Eliot Horowitz <eliothorowitz@gmail.com>
To: mongodb-user@googlegroups.com
Sent: Thu, August 19, 2010 2:39:00 PM
Subject: Re: [mongodb-user] Java Driver Connection Question for Replication Set

Couple of comments:

  • only 1 machine out of the 12 can be a master at any time
  • the java driver is designed to give it any # of servers, and it'll
    send all writes/reads to the master
  • we can add an option in the java driver to send reads to slaves,
    can you open a jira case?
  • you really need more data center awareness than we support right
    now, though its planned

Can you give us a little more info about what you're trying to do overall?

One option right is this:

  • make A1, B1, C1, D1 have priority 1 and the other priorities 0.
    Then only the 1s can be master
  • in each data center, make a List<ServerAddress> with all the nodes
    in your datacenter and all the 1s.
  • doing read slave support is pretty simple in the java driver if needed

On Thu, Aug 19, 2010 at 5:20 PM, Joseph Wang <josephykwang@yahoo.com> wrote:
> We have 3 colos. For each colo, we want to have 4 machines participating in a
> replication set.
> For discussion purpose, let's name these machine A1, A2, A3, A4, B1, B2, B3, B4,
> C1,
> C2, C3, and C4. Let A1, B1, C1, and D1 be the original masters. We want read to
> hit slaves.
>
> Update processor w/i each colo will send updates to master w/i the corresponding
> colo.
>
> Looking at http://api.mongodb.org/java/2.1/index.html, it is not clear how one
> will specify
> the connection string for replication set. It has example for replication pair.
>
> 1. What should the connection string be used for read for each colo? Note that
> we only want
> read to hit slaves since we've high updates hitting master w/i a colo.
> 2. What should the connection string be used for write for each colo? Couldn't
> be just A1 since
> there is a possibility of A1 failure.
> 3. Is it possible to specify that machines in colo A should hit slaves in colo A
> then hit slaves
> in colos B and C if all machines in A have problem?
>
>

  • make A1, B1, C1, D1 have priority 1 and the other priorities 0.
    Then only the 1s can be master
  • in each data center, make a List<ServerAddress> with all the nodes
    in your datacenter and all the 1s.
  • doing read slave support is pretty simple in the java driver if needed


 Comments   
Comment by Eliot Horowitz (Inactive) [ 30/Aug/10 ]

meant JAVA-147

Comment by Eliot Horowitz (Inactive) [ 29/Aug/10 ]

See SERVER-147

Generated at Thu Feb 08 08:51:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.