Re: Need help with moving to Riak

2013-03-22 Thread Max Lapshin
Hi. Of course, denormalization will not work, because I need to make lookups inside clients and servers. I'm trying to understand how to use KV databases in real life (not for storing configuration), but it is a big problem: there are a lot of easy and excelent tutorials that tell how to store yo

Re: Need help with moving to Riak

2013-03-22 Thread Christian Dahlqvist
Hi Max, Although using secondary indexes most likely can be used to solve your problem, it may not be the most efficient way. When migrating to Riak from a relational model one often need to alter the data model depending on how you will need to use and search the data rather than migrate it d

Re: Need help with moving to Riak

2013-03-22 Thread Daniil Churikov
One possible scheme: To optimize reads, I advice such scheme: Bucket <<"clients">>, by client_id you store client info and all his users in one object. Bucket <<"servers">>, by client_id you store all his servers in one object. Move user statistics into separate object: Bucket <<"usage_stats">>,

Re: Need help with moving to Riak

2013-03-22 Thread Martin Westergaard Lassen
Hi MaxTo get the best performance form Riak you should denormalise your tables. But that again depends on how many User and Server entities a Client has. Ideally you denormalise your datamodel into{  "title": "foo",  "limit": 1,  "clients": [    {      "title": "bar",      "limit": 2    }  ]  "serv