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
g like statebox for this. So to execute "give me all sub-users of this client" you will have to make 2 queries: to <<"clients">> bucket and to <<"usage_stats">> bucket. "give me all servers of this client" will require one query.

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

Need help with moving to Riak

2013-03-21 Thread Max Lapshin
Hi. I'm looking for alternative to postgresql in my project. I have two problems with postgres: 1) if master goes down, problem must be resolved manually and very quickly 2) I want cross datacenter replication Here is my schema: http://pastie.org/7058511 In short: client is a user that is logging