[erlang-questions] Getting attributes

Mike Oxford <>
Sun Oct 14 03:52:17 CEST 2012


Sure; you have two ways of doing this.
1)  Key = {x,y} and just make queries for each surrounding node to get the
attributes.  This requires more read calls.
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.

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.)
#1 takes more reads which are relatively cheap.

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.

-mox

On Sat, Oct 13, 2012 at 4:38 PM, Steve Davis <
> wrote:

> I understated the issue:
>
> The position of the entity can also change:
> {id, {x,y}, attribute}
>
> So, in fact, the id is the only constant and the pos and attribute are
> independently mutable.
>
>
>
> On Oct 13, 2012, at 6:23 PM, Steve Davis <>
> wrote:
>
> > Hi all,
> >
> > Suppose I have a 2 dimensional plane {x, y} of 64k by 64k coordinates.
> >
> > Each coordinate has a mutable attribute {{x, y}, attribute}
> >
> > If I need to query: What are the attributes of positions "next to" my
> position, i.e: x +- 1, y +- 1?
> >
> > What is the correct solution to this without storing everything in
> "Oracle" and using relational queries?
> >
> > Can this be sensibly maintained in a KV store?
> >
> > /s
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121013/dedce2fa/attachment.html>


More information about the erlang-questions mailing list