Note that there are some explanatory texts on larger screens.

plurals
  1. POSchema-less design guidelines for Google App Engine Datastore and other NoSQL DBs
    text
    copied!<p>Coming from a relational database background, as I'm sure many others are, I'm looking for some solid guidelines for setting up / designing my datastore on Google App Engine. Are there any good rules of thumb people have for setting up these kinds of schema-less data stores? I understand some of the basics such as denormalizing since you can't do joins, but I was wondering what other recommendations people had.</p> <p>The particular simple example I am working with concerns storing searches and their results. For example I have the following two models defined in my Google App Engine app using Python:</p> <pre class="lang-python prettyprint-override"><code>class Search(db.Model): who = db.StringProperty() what = db.StringProperty() where = db.StringProperty() createDate = db.DateTimeProperty(auto_now_add=True) class SearchResult(db.Model): title = db.StringProperty() content = db.StringProperty() who = db.StringProperty() what = db.StringProperty() where = db.StringProperty() createDate = db.DateTimeProperty(auto_now_add=True) </code></pre> <p>I'm duplicating a bunch of properties between the models for the sake of denormalization since I can't join <code>Search</code> and <code>SearchResult</code> together. Does this make sense? Or should I store a search ID in the <code>SearchResult</code> model and effectively "join" the two models in code when I retrieve them from the datastore? Please keep in mind that this is a simple example. Both models will have a lot more properties and the way I'm approaching this right now, I would put any property I put in the Search model in the <code>SearchResult</code> model as well.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload