Google App Engine and database "Views"

436 views Asked by At

I'm developing an application for GAE that has a fairly complex data model.

Based on my understanding, a good way to handle a complex data model using a noSQL database, especially GAE, is to use de-normalized "views" of data. If the browser-client wants to update some data, the server performs a write on some core data, returns "200 OK" so the client can continue, then uses the task que to update any "views" that the written data may have affected.

Then whenever the client wants to query for some objects that would normally require a SQL-join, it can instead query a "view" where all the data it needs is right there in the same "row" (or entity, in app engine's case).

The problem I am having is that all this creating and updating of views seems to be something that a library should be doing, not something I should be doing manually. Is there a tool that works with GAE where you can specify some views of your data and then expect that they will be created and handled appropriately? I believe CouchDB does this...

1

There are 1 answers

4
Nick Johnson On BEST ANSWER

Views are more usually an RDBMS feature than a nonrel one. What you're describing sounds like materialized views, though, and while they're a valid solution, they're not a common one, and thus there aren't any libraries for App Engine (that I'm aware of) that do this.

More common is to simply store your data denormalized in a fashion that facilitates efficient reading, and update the data directly at write time.