riak-ripple / ripple

A rich Ruby modeling layer for Riak, Basho's distributed database
Other
619 stars 152 forks source link

PB client unnecessarily fetched object when storing object using prevent_stale_writes #233

Closed eliaslevy closed 12 years ago

eliaslevy commented 12 years ago

If you set prevent_stale_writes the PB client first fetches the key to compare the vector clocks itself. See beefcake_protobuffs_backend.rb: store_object.

But this is unnecessary and adds an additional round trip of latency to the request. Riak supports the if_not_modified options in the PB interface, which will let Riak perform the check itself.

See http://wiki.basho.com/PBC-Store-Object.html

seancribbs commented 12 years ago

I wanted to avoid it, but we'll need to make a get_server_info request to determine whether this option is even available. Unfortunately, if you send unknown fields in a PB message, the Erlang side will crash (known issue, not being fixed on 0.14.x).

On Sat, Oct 29, 2011 at 5:24 PM, eliaslevy < reply@reply.github.com>wrote:

If you set prevent_stale_writes the PB client first fetches the key to compare the vector clocks itself. See beefcake_protobuffs_backend.rb: store_object.

But this is unnecessary and adds an additional round trip of latency to the request. Riak supports the if_not_modified options in the PB interface, which will let Riak perform the check itself.

See http://wiki.basho.com/PBC-Store-Object.html

Reply to this email directly or view it on GitHub: https://github.com/seancribbs/ripple/issues/233

Sean Cribbs sean@basho.com Developer Advocate Basho Technologies, Inc. http://www.basho.com/

seancribbs commented 12 years ago

Moved to https://github.com/basho/riak-ruby-client/issues/5