Reputation: 99
Is there any tutorial or trick to implement many-to-many relations in GAE. Basically how can we still use datastore and also get benefited from JOIN and relations in JPA.
Upvotes: 1
Views: 123
Reputation: 2056
Datastore is at heart a noSQL persistence mechanism. Joining across data tables simply isn't something it is designed to do. If you can find reasonable ways to query one table to get a set of keys and query the second you can make this work. Or if you can find a reasonable way to have a list of "foreign keys" in you data model you can also attain such queries. (Though if you have multiple lists that share an index prepare for an index explosion.)
This is great when you need to scale to very large dbs as these can be sharded across servers. However you are sacrificing the SQL flexibility you are used to and you lose your constraint checks (they become application code instead of db code). You may want to investigate Google cloud SQL if you have reasonable datasets (less than multiple terabytes)
Upvotes: 1