Sure; you have two ways of doing this.<div>1)  Key = {x,y} and just make queries for each surrounding node to get the attributes.  This requires more read calls.</div><div>2)  Key = {x,y} and you COPY all of the data from the surrounding nodes into it.  This requires only 1 read call, but much more work on the write-side as things move around.</div>
<div><br></div><div>On a heavy-write system, #2 will spend a lot of time blocked as everything is updating everything around it when it moves (from cluster + to cluster.)</div><div>#1 takes more reads which are relatively cheap.</div>
<div><br></div><div>It depends on your read/write profile balance.  On a very heavy "read" system where thing do not move often, #2 will be best.  On a system with lots of moving around, #1 is better.  Where that boundary line lies is specific to your own application's patterns and this figuring out this pattern will dictate which method is best (or even if you really want to go KV for this.)  Profile it, even if your first-pass profile is just on paper/pencil.</div>
<div><br></div><div>-mox<br><br><div class="gmail_quote">On Sat, Oct 13, 2012 at 4:38 PM, Steve Davis <span dir="ltr"><<a href="mailto:steven.charles.davis@gmail.com" target="_blank">steven.charles.davis@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I understated the issue:<br>
<br>
The position of the entity can also change:<br>
{id, {x,y}, attribute}<br>
<br>
So, in fact, the id is the only constant and the pos and attribute are independently mutable.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On Oct 13, 2012, at 6:23 PM, Steve Davis <<a href="mailto:steven.charles.davis@gmail.com">steven.charles.davis@gmail.com</a>> wrote:<br>
<br>
> Hi all,<br>
><br>
> Suppose I have a 2 dimensional plane {x, y} of 64k by 64k coordinates.<br>
><br>
> Each coordinate has a mutable attribute {{x, y}, attribute}<br>
><br>
> If I need to query: What are the attributes of positions "next to" my position, i.e: x +- 1, y +- 1?<br>
><br>
> What is the correct solution to this without storing everything in "Oracle" and using relational queries?<br>
><br>
> Can this be sensibly maintained in a KV store?<br>
><br>
> /s<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div>