[mongodb-user] Read consistency a la Cassandra

Showing 1-14 of 14 messages
[mongodb-user] Read consistency a la Cassandra Om 9/14/11 9:53 AM
Hi,

 I know mongo offers grantees with writes succeeding on multiple nodes
(using getLastError). Is there a way to perform read consistency in
mongo (i.e. read from multiple nodes and ensure that valur returned by
them is same, if not perform a read-merge). This is something that
Cassandra offers http://www.slideshare.net/benjaminblack/introduction-to-cassandra-replication-and-consistency.

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Re: [mongodb-user] Read consistency a la Cassandra Eliot Horowitz 9/14/11 10:11 AM
Generally if you want to do consistent reads you would just read from
the primary (which is the default).
[mongodb-user] Re: Read consistency a la Cassandra Om 9/14/11 10:13 AM
I know. But if I wanted to read from secondaries (to distribute my
read load), then I'd like to read from multiple secondaries (because
mongo offers eventual consistency). Is there a way for doing this in
mongo?

On Sep 14, 10:11 am, Eliot Horowitz <el...@10gen.com> wrote:
> Generally if you want to do consistent reads you would just read from
> the primary (which is the default).
>
>
>
>
>
>
>
> On Wed, Sep 14, 2011 at 12:53 PM, Om <omkar.ti...@gmail.com> wrote:
> > Hi,
>
> >  I know mongo offers grantees with writes succeeding on multiple nodes
> > (using getLastError). Is there a way to perform read consistency in
> > mongo (i.e. read from multiple nodes and ensure that valur returned by
> > them is same, if not perform a read-merge). This is something that
> > Cassandra offershttp://www.slideshare.net/benjaminblack/introduction-to-cassandra-rep....

>
> > --
> > You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> > To post to this group, send email to mongod...@googlegroups.com.
> > To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/mongodb-user?hl=en.

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Re: [mongodb-user] Re: Read consistency a la Cassandra Andreas Jung 9/14/11 10:20 AM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You have to ensure that every write operation propagated the changes
to *every* secondary node:

http://www.mongodb.org/display/DOCS/Verifying+Propagation+of+Writes+with+getLastError

Then reads should be consistent - race conditions are likely possible in
edge cases.

- -aj

Om wrote:
> I know. But if I wanted to read from secondaries (to distribute my
> read load), then I'd like to read from multiple secondaries (because
> mongo offers eventual consistency). Is there a way for doing this in
> mongo?
>
> On Sep 14, 10:11 am, Eliot Horowitz <el...@10gen.com> wrote:
>> Generally if you want to do consistent reads you would just read
>> from the primary (which is the default).
>>
>>
>>
>>
>>
>>
>>
>> On Wed, Sep 14, 2011 at 12:53 PM, Om <omkar.ti...@gmail.com>
>> wrote:
>>> Hi, I know mongo offers grantees with writes succeeding on
>>> multiple nodes (using getLastError). Is there a way to perform
>>> read consistency in mongo (i.e. read from multiple nodes and
>>> ensure that valur returned by them is same, if not perform a
>>> read-merge). This is something that Cassandra
>>> offershttp://www.slideshare.net/benjaminblack/introduction-to-cassandra-rep....
>>>
>>>
- --

>>> You received this message because you are subscribed to the
>>> Google Groups "mongodb-user" group. To post to this group, send
>>> email to mongod...@googlegroups.com. To unsubscribe from this
>>> group, send email to mongodb-user...@googlegroups.com.
>>> For more options, visit this group
>>> athttp://groups.google.com/group/mongodb-user?hl=en.
>

- --
ZOPYX Limited           | zopyx group
Charlottenstr. 37/1     | The full-service network for Zope & Plone
D-72070 Tübingen        | Produce & Publish
www.zopyx.com           | www.produce-and-publish.com
- ------------------------------------------------------------------------
E-Publishing, Python, Zope & Plone development, Consulting


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJOcOJQAAoJEADcfz7u4AZjWmMLv0G2UCSyG19pz6n90eN7zp+e
dcg1wf1GFMs5YZJYH46p19QYJelSSm1DmI2YUCdCSF8AoizoJ0wz6G5rGZaohL4U
A7KA67pUp8nBCuGeOt29chTgcnogFrNNe94Uw2QRAable6tYqbz5GeO9B3hg/LCt
YqfZg3clRY/K0sUqqbQ/+XICaLQ+K+5EuQHbvqbmJD0pzus5RUscXizsLpFRUhIf
kJqmpDFrVo2+VlGxi3jwSzpKD18XeSd0xhiK+NK+nO86JibFoghz770aBuS2IKK9
zaswHL2vq6fmsJoXE6osxFvgkDJIZpI+VP2KmNlocnqfoxZTcBWJHBMA+wXtxn98
r9R/AWXixXab7jGZGpzov+wQTQxDuO3nwOZgENT8qEArkKRSf711HRJG0/0y6G/R
gOC01g8UY01Ekgf1DUXa93QrB1w4FPDAG/eoCJmyoX1lI/EyxHPit1HFhuCgTsbZ
54MEorOCgb+IIu7kBIzDFtDxVmqkjes=
=GjAb
-----END PGP SIGNATURE-----

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Re: [mongodb-user] Re: Read consistency a la Cassandra Eliot Horowitz 9/14/11 10:19 AM
Nothing built in.
You could do it with a combination of w=X and reading from a set of
secondaries, but it might be easier just to have shard and read from
primaries.
[mongodb-user] Re: Read consistency a la Cassandra Om 9/14/11 10:54 AM
Cassandra offers read and write consistency if R+W>N (this ensures
overlap between read and write nodes). So we don't need R=N (as might
be necessary for mongodb).

On Sep 14, 10:20 am, Andreas Jung <li...@zopyx.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> You have to ensure that every write operation propagated the changes
> to *every* secondary node:
>
> http://www.mongodb.org/display/DOCS/Verifying+Propagation+of+Writes+w...> D-72070 T�bingen        | Produce & Publishwww.zopyx.com          |www.produce-and-publish.com

> - ------------------------------------------------------------------------
> E-Publishing, Python, Zope & Plone development, Consulting
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (Darwin)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/

>
> iQGUBAEBAgAGBQJOcOJQAAoJEADcfz7u4AZjWmMLv0G2UCSyG19pz6n90eN7zp+e
> dcg1wf1GFMs5YZJYH46p19QYJelSSm1DmI2YUCdCSF8AoizoJ0wz6G5rGZaohL4U
> A7KA67pUp8nBCuGeOt29chTgcnogFrNNe94Uw2QRAable6tYqbz5GeO9B3hg/LCt
> YqfZg3clRY/K0sUqqbQ/+XICaLQ+K+5EuQHbvqbmJD0pzus5RUscXizsLpFRUhIf
> kJqmpDFrVo2+VlGxi3jwSzpKD18XeSd0xhiK+NK+nO86JibFoghz770aBuS2IKK9
> zaswHL2vq6fmsJoXE6osxFvgkDJIZpI+VP2KmNlocnqfoxZTcBWJHBMA+wXtxn98
> r9R/AWXixXab7jGZGpzov+wQTQxDuO3nwOZgENT8qEArkKRSf711HRJG0/0y6G/R
> gOC01g8UY01Ekgf1DUXa93QrB1w4FPDAG/eoCJmyoX1lI/EyxHPit1HFhuCgTsbZ
> 54MEorOCgb+IIu7kBIzDFtDxVmqkjes=
> =GjAb
> -----END PGP SIGNATURE-----
>
>  lists.vcf
> < 1KViewDownload

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Re: [mongodb-user] Re: Read consistency a la Cassandra Eliot Horowitz 9/14/11 10:59 AM
You can do the same R+W>N if you want, drivers just don't have it
built in since its not the common way people use mongo.
[mongodb-user] Re: Read consistency a la Cassandra Om 9/14/11 11:00 AM
Right. But how could I block read untill I read from R number of
nodes? I can do this for writes. Not for reads. ...right?

On Sep 14, 10:59 am, Eliot Horowitz <el...@10gen.com> wrote:
> You can do the same R+W>N if you want, drivers just don't have it
> built in since its not the common way people use mongo.
>
>
>
>
>
>
>
> > For more options, visit this group athttp://groups.google.com/group/mongodb-user?hl=en.

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

[mongodb-user] Re: Read consistency a la Cassandra Kristina Chodorow 9/14/11 11:19 AM
Correct.  You'd have to set w to W in getLastError, read from R nodes
manually, and as long as R+W>N, you know one of those is up to date.
As mentioned before in this thread, though, MongoDB doesn't have the
same consistency model as Cassandra so this isn't really necessary,
you can just read from the primary.  If you're trying to distribute
the load, shard.


On Sep 14, 2:10 pm, Om <omkar.ti...@gmail.com> wrote:
> I'd have to manually connect with R nodes and then read the data. Then
> compare and then make the decision based on that ...right? Just
> reading R times won't ensure that I read from R different nodes.

[mongodb-user] Re: Read consistency a la Cassandra Om 9/14/11 11:23 AM
What type of algorithm (technique) does mongo use to distribute chunks
on shard servers? Is it done in an "intelligent" manner?
[mongodb-user] Re: Read consistency a la Cassandra Om 9/14/11 11:10 AM
I'd have to manually connect with R nodes and then read the data. Then
compare and then make the decision based on that ...right? Just
reading R times won't ensure that I read from R different nodes.

On Sep 14, 11:00 am, Om <omkar.ti...@gmail.com> wrote:

[mongodb-user] Re: Read consistency a la Cassandra Kristina Chodorow 9/14/11 11:36 AM
It uses write-triggered splitting/migrating to keep the number of
chunks even between shards.  You might want to read through the
sharding documentation, if you haven't: http://www.mongodb.org/display/DOCS/Sharding+Introduction
[mongodb-user] Re: Read consistency a la Cassandra Om 9/14/11 12:01 PM
Thanks for help Kristina.
[mongodb-user] Re: Read consistency a la Cassandra Kristina Chodorow 9/14/11 12:33 PM
No problem, good luck!