It may be both; -)
If you execute 400 queries in the Rewards table, one for each result returned for the query in the mapping table, then I expect it to be painful. There is a limit to 1000 results for queries because BigTable believes that returning 1000 results is limited by its ability to work in a reasonable amount of time. Based on the architecture, I would expect 400 queries to be slower than one query returning 400 results (400 log N versus (log M) + 400).
The good news is that in GAE memcaching, one hash table containing all the rewards and their score values ββis pretty simple (well, it looked pretty simple when I looked at memcache docs a while ago. Do it yet).
Also, if you do not already know, for result in query.fetch(1000) faster than for result in query , and you are limited to 1000 results anyway. The advantages of the latter: (1) it can be faster if you help out early, and (2) if Google ever increases the limit above 1000, it will benefit without changing the code.
You may also have problems deleting the user (or reward). I found in one test that I can delete 300 objects in a while. These objects were more complex than your mapping objects, having 3 properties and 5 indexes (including implicit), while your mapping table probably only has 2 properties and 2 (implicit) indexes. [Edit: just realized that I did this test before I found out that db.delete () can take a list, which is probably much faster].
BigTable does not necessarily do what relational databases are designed to achieve the best results. Instead, it distributes data well across many nodes. But almost all websites work fine with a bottleneck on the same db server and, therefore, do not require strict attention to what BigTable does.
One more thing: if you execute 400 data warehouse requests on one HTTP request, you will find that you have set a fixed storage quota long before you get to a fixed quota of your request. Of course, if you feel good about quotas, or if you click something else first, then this may not be relevant for your application. But the ratio between the two quotas is something like 8: 1, and I take it as a hint at what Google expects my data model to look like.
Steve Jessop Jun 05 '09 at 8:44 2009-06-05 08:44
source share