<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:51:36 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-149] Allow option to read from slaves from replication set and write to master only</title>
                <link>https://jira.mongodb.org/browse/JAVA-149</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;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.&lt;/p&gt;


&lt;p&gt;From: Eliot Horowitz &amp;lt;eliothorowitz@gmail.com&amp;gt;&lt;br/&gt;
To: mongodb-user@googlegroups.com&lt;br/&gt;
Sent: Thu, August 19, 2010 2:39:00 PM&lt;br/&gt;
Subject: Re: &lt;span class=&quot;error&quot;&gt;&amp;#91;mongodb-user&amp;#93;&lt;/span&gt; Java Driver Connection Question for Replication Set&lt;/p&gt;

&lt;p&gt;Couple of comments:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;only 1 machine out of the 12 can be a master at any time&lt;/li&gt;
	&lt;li&gt;the java driver is designed to give it any # of servers, and it&apos;ll&lt;br/&gt;
send all writes/reads to the master&lt;/li&gt;
	&lt;li&gt;we can add an option in the java driver to send reads to slaves,&lt;br/&gt;
can you open a jira case?&lt;/li&gt;
	&lt;li&gt;you really need more data center awareness than we support right&lt;br/&gt;
now, though its planned&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Can you give us a little more info about what you&apos;re trying to do overall?&lt;/p&gt;

&lt;p&gt;One option right is this:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;make A1, B1, C1, D1 have priority 1 and the other priorities 0.&lt;br/&gt;
Then only the 1s can be master&lt;/li&gt;
	&lt;li&gt;in each data center, make a List&amp;lt;ServerAddress&amp;gt; with all the nodes&lt;br/&gt;
in your datacenter and all the 1s.&lt;/li&gt;
	&lt;li&gt;doing read slave support is pretty simple in the java driver if needed&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;On Thu, Aug 19, 2010 at 5:20 PM, Joseph Wang &amp;lt;josephykwang@yahoo.com&amp;gt; wrote:&lt;br/&gt;
&amp;gt; We have 3 colos. For each colo, we want to have 4 machines participating in a&lt;br/&gt;
&amp;gt; replication set.&lt;br/&gt;
&amp;gt; For discussion purpose, let&apos;s name these machine A1, A2, A3, A4, B1, B2, B3, B4,&lt;br/&gt;
&amp;gt; C1,&lt;br/&gt;
&amp;gt; C2, C3, and C4.  Let A1, B1, C1, and D1 be the original masters. We want read to&lt;br/&gt;
&amp;gt; hit slaves.&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt; Update processor w/i each colo will send updates to master w/i the corresponding&lt;br/&gt;
&amp;gt; colo.&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt; Looking at &lt;a href=&quot;http://api.mongodb.org/java/2.1/index.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://api.mongodb.org/java/2.1/index.html&lt;/a&gt;, it is not clear how one&lt;br/&gt;
&amp;gt; will specify&lt;br/&gt;
&amp;gt; the connection string for replication set. It has example for replication pair.&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt; 1. What should the connection string be used for read for each colo? Note that&lt;br/&gt;
&amp;gt; we only want&lt;br/&gt;
&amp;gt; read to hit slaves since we&apos;ve high updates hitting master w/i a colo.&lt;br/&gt;
&amp;gt; 2. What should the connection string be used for write for each colo? Couldn&apos;t&lt;br/&gt;
&amp;gt; be just A1 since&lt;br/&gt;
&amp;gt; there is a possibility of A1 failure.&lt;br/&gt;
&amp;gt; 3. Is it possible to specify that machines in colo A should hit slaves in colo A&lt;br/&gt;
&amp;gt; then hit slaves&lt;br/&gt;
&amp;gt; in colos B and C if all machines in A have problem?&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt;&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;make A1, B1, C1, D1 have priority 1 and the other priorities 0.&lt;br/&gt;
Then only the 1s can be master&lt;/li&gt;
	&lt;li&gt;in each data center, make a List&amp;lt;ServerAddress&amp;gt; with all the nodes&lt;br/&gt;
in your datacenter and all the 1s.&lt;/li&gt;
	&lt;li&gt;doing read slave support is pretty simple in the java driver if needed&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="12841">JAVA-149</key>
            <summary>Allow option to read from slaves from replication set and write to master only</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="3">Duplicate</resolution>
                                        <assignee username="eliot">Eliot Horowitz</assignee>
                                    <reporter username="josephykwang">Joseph Wang</reporter>
                        <labels>
                    </labels>
                <created>Fri, 20 Aug 2010 00:11:06 +0000</created>
                <updated>Mon, 30 Aug 2010 18:46:09 +0000</updated>
                            <resolved>Sun, 29 Aug 2010 03:57:57 +0000</resolved>
                                    <version>2.1</version>
                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="17564" author="eliot" created="Mon, 30 Aug 2010 18:46:09 +0000"  >&lt;p&gt;meant &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-147&quot; title=&quot;Automatically routing of queries to non-master nodes (if slave_ok set)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-147&quot;&gt;&lt;del&gt;JAVA-147&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="17531" author="eliot" created="Sun, 29 Aug 2010 03:57:56 +0000"  >&lt;p&gt;See &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-147&quot; title=&quot;make Tools have username/password option&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-147&quot;&gt;&lt;del&gt;SERVER-147&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrhcyn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14900</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>