Responses inline. --- Jeremiah Peschka - Founder, Brent Ozar Unlimited MCITP: SQL Server 2008, MVP Cloudera Certified Developer for Apache Hadoop
On Wed, Aug 7, 2013 at 2:28 AM, Maksymilian Strzelecki <[email protected]>wrote: > Hi. I've read somewhere around the Internet that Riak benefits its > performence when there are more buckets and not massive amount of keys in > them. Now, if this is true I'm asking for an advice on how to go about my > data model. > Riak can benefit from having a large number of buckets, but it's very use case specific. > I've started off with one bucket called accounts_units. Every player has > his set of units in-game (like 10-20) and they all have their individual > keys in there. Since knowing what your units are is pretty important thing > I would be doing a lot of queries on that bucket. Then I thought I could > create individual buckets for every player and his units. Though it would > create A LOT of buckets with little keys. Would that be better? What do you > think? > In direct answer to your question, your data model might be better served by storing all of a player's units in a single value; e.g. units/peschkaj instead of having between 10 and 20 keys in a units_peschkaj bucket. The reasoning here being that a read of a single key is going to be less load on the system than 20 reads, even though that one key might be 20x larger. You need to be aware of data access patterns - if multiple actors in your system can modify the same value, then you need to account for that in your data access patterns and either serialize writes through a single point (not a great idea for concurrency) or potentially allow conflicts to occur and have your application manage sibling resolution. You also need to be aware of the size of each value that you're storing, especially if you have siblings. There are performance implications of storing objects around 4MB in size. > > Thanks for your time, > Max. > > _______________________________________________ > riak-users mailing list > [email protected] > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > >
_______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
