Not sure if this has been asked before but I'm interested to find out
how are you modeling one-to-many and many-to-many entity
relationship.
I find it hard to wrap my head around datastore that's no
relationtional.
a key value store system like most of the NOSQL systems
is designed for you to get and update values based on a key.
What you gain is the flexibility of schema free.
so, when you design your data, you have to design it with
that in mind.
Most of these systems are designed to purposely avoid joins
and operations of that nature due to problems that occur
when you have billions of datasets.
2010/1/6 Seymores <seym...@gmail.com>:
> --
> Vous recevez ce message, car vous êtes abonné au groupe Google Groupes Gaelyk.
> Pour envoyer un message à ce groupe, adressez un e-mail à gae...@googlegroups.com.
> Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse gaelyk+un...@googlegroups.com.
> Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/gaelyk?hl=fr
>
>
>
>
--
Omnem crede diem tibi diluxisse supremum.
I think, if I'm not mistaken, that one way of implementing one-to-many
would simply to have a property in your first entity that lists Keys,
and have the linked entities also have a property listing Keys back in
the other direction. I suspect this is how they mimick one-to-many
with the JDO / JPA implementations.
2010/1/6 Seymores <seym...@gmail.com>:
> --
> Vous recevez ce message, car vous êtes abonné au groupe Google Groupes Gaelyk.
> Pour envoyer un message à ce groupe, adressez un e-mail à gae...@googlegroups.com.
> Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse gaelyk+un...@googlegroups.com.
> Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/gaelyk?hl=fr
>
>
>
>
--
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one
2010/1/6 Guillaume Laforge <glaf...@gmail.com>:
--
That said, there are some really poweful things you can do with such a
datastore that would be very hard with a classical RDBMS anyway.
For instance, with the datastore, you can query every entity (here I
really mean across all entity kinds) and find all queries that have a
certain tag.
With a relation database, you'd have to run as many queries, and
aggregate the results somehow programmatically.
With the datastore, just one query is needed for that.
Pretty powerful.
So in general, as you said, it's good to be able to place oneself in a
different mindset, so as to take the most of the different paradigm,
but it's not always easy, with all the habits and knowledge we have
with one paradigm!
Guillaume
2010/1/6 Wilson MacGyver <wmac...@gmail.com>:
Right now, the only example I can find is the code from groovy console
-- really helpful.
sey
On Jan 7, 12:02 am, Wilson MacGyver <wmacgy...@gmail.com> wrote:
> That's possible. I do notice that JPA degrades quickly when
> you use it that way when I was testing it in the initial release.
>
> 2010/1/6 Guillaume Laforge <glafo...@gmail.com>:
>
>
>
> > Yeah that's a good question, but that's not been asked yet.
>
> > I think, if I'm not mistaken, that one way of implementing one-to-many
> > would simply to have a property in your first entity that lists Keys,
> > and have the linked entities also have a property listing Keys back in
> > the other direction. I suspect this is how they mimick one-to-many
> > with the JDO / JPA implementations.
>
> > 2010/1/6 Seymores <seymo...@gmail.com>:
2010/1/7 Seymores <seym...@gmail.com>:
> I'm curious how it works, do you have some sample code?
I don't have code handy actually.
But in pseudo code, it could look something like this:
Imagine a many-to-many relationship where a student can have many
teachers and a teacher many students.
def s1 = new Entity("student #1")
def s2 = ...
def t1 = new Entity("teacher #1")
def t2 = ...
s1.teachers = [t1.key, t3.key]
t2.students = [s1.key, s2.key, s3.key]
That should look something like the above I believe.
> Right now, the only example I can find is the code from groovy console
> -- really helpful.
Thanks... but probably not that helpful, in the sense that there's no
relationships, since there's just one entity :-)
But at some point, that would be good to have various samples of
various scenarios, so that it gives good hints on how to best
implement things!
Guillaume
On Jan 7, 3:28 pm, Guillaume Laforge <glafo...@gmail.com> wrote:
> Hi,
>
> 2010/1/7 Seymores <seymo...@gmail.com>: