<p>Since the Google App Engine Datastore is based on <a href="http://research.google.com/archive/bigtable.html" rel="noreferrer">Bigtable</a> and we know that's not a relational database, how do you design a <strong><em>database schema</em>/<em>data model</em></strong> for applications that use this type of database system?</p>

[{'answer_id': 80420, 'author': 'mbesso', 'author_id': 9510, 'author_profile': 'https://Stackoverflow.com/users/9510', 'pm_score': -1, 'selected': False, 'text': '<p>As GAE builds on how data is managed in Django there is a lot of info on how to address similar questions in the Django documentation (for example see <a href="http://www.djangobook.com/en/1.0/chapter05/" rel="nofollow noreferrer">here</a>, scroll down to \'Your first model\').</p>\n\n<p>In short you design you db model as a regular object model and let GAE sort out all of the object-relational mappings. </p>\n'}, {'answer_id': 80425, 'author': '0124816', 'author_id': 11521, 'author_profile': 'https://Stackoverflow.com/users/11521', 'pm_score': 5, 'selected': True, 'text': '<p>Designing a bigtable schema is an open process, and basically requires you to think about:</p>\n\n<ul>\n<li>The access patterns you will be using and how often each will be used</li>\n<li>The relationships between your types</li>\n<li>What indices you are going to need</li>\n<li>The write patterns you will be using (in order to effectively spread load)</li>\n</ul>\n\n<p>GAE\'s datastore automatically denormalizes your data. That is, each index contains a (mostly) complete copy of the data, and thus every index adds significantly to time taken to perform a write, and the storage space used.</p>\n\n<p>If this were not the case, designing a Datastore schema would be a lot more work: You would have to think carefully about the primary key for each type, and consider the effect of your decision on the locality of data. For example, when rendering a blog post you would probably need to display the comments to go along with it, so each comment\'s key would probably begin with the associated post\'s key.</p>\n\n<p>With Datastore, this is not such a big deal: The query you use will look something like "Select * FROM Comment WHERE post_id = N." (If you want to page the comments, you would also have a limit clause, and a possible suffix of " AND comment_id > last_comment_id".) Once you add such a query, Datastore will build the index for you, and your reads will be magically fast.</p>\n\n<p>Something to keep in mind is that each additional index creates some additional cost: it is best if you can use as few access patterns as possible, since it will reduce the number of indices GAE will construct, and thus the total storage required by your data.</p>\n\n<p>Reading over this answer, I find it a little vague. Maybe a hands-on design question would help to scope this down? :-)</p>\n'}, {'answer_id': 196660, 'author': 'massimo', 'author_id': 24489, 'author_profile': 'https://Stackoverflow.com/users/24489', 'pm_score': 1, 'selected': False, 'text': '<p>You can use www.web2py.com. You build the model and the application once and it works on GAE but also witl SQLite, MySQL, Posgres, Oracle, MSSQL, FireBird</p>\n'}]
['https://Stackoverflow.com/questions/79850', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10708/']