On 18-02-2012 12:09, Rajat Mathur wrote:
I am new to NOSQL and have chosen RIAK for my application. I am using
*Riak-Java-Client*.
Welcome!
> I need to update values of keys in a bucket. Values are JSON objects.
Do I have to query the whole JSON object to update a field in it.
Yes. Riak doesn't know or care about the data structure of your stored
values. You have to GET the data, parse the JSON, modify the data,
generate new JSON, and PUT the new value back. This might seem as a
performance-killer, but usually isn't. We do it for tiny modifications
for zipped objects of about 100k size with good performance.
* Also what are the methods for implementing *where* clause in it.
A common feature/limitation in most NoSQL databases including riak is
that you must know which queries you'll be doing, before you define the
data structure and put in the data. You do not have the flexibility to
make well-performing ad hoc WHERE searches as you do in a SQL-database.
But there are other ways. Consider if you can define your key in a way,
so you get the right resultset from doing a range-search from key1 to
key2. You can also consider storing your data with secondary indeces for
looking up on. It is my understanding, that riak does not (yet) support
queries combining multiple secondary indeces in AND or OR searches.
I didn't found much /examples with codes*written in JAVA.*/**If
someone knows any sources for the same please let me know.
Try the quick start here:
https://github.com/basho/riak-java-client/blob/master/README.org
---
Best regards / Venlig hilsen
Rune Skou Larsen
Team Riak / Trifork Public A/S
Margrethepladsen 4, 8000 Ã…rhus C, Denmark
twitter: @RuneSkouLarsen
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com