The Problem
After days of reading the documentation of the app engine and the datastore I couldnt seem to understand how to build a real-world scalable application.
nor could I find any good examples for best practice. sure I can make my application work but I cant know if it is any good for scaling to more than the load my development environment can supply.
it clearly states on the app-engine tutorial of using the datastore that: "However, the rate at which you can write to the same entity group is limited to 1 write to the entity group per second. When you design a real application you'll need to keep this fact in mind."
Assumptions
I assume as for what I understand (please correct me if I am wrong) that given the datastore root is / then /Users/* (Keys) is an entity group and /Products/Beauty/* is an entity group which are effected by the previous limit of 1 write per second. (Is /Products/Beauty/* is limited by /Products/* aswell?)
Did I miss understand this?
Example
Lets assume we want to build a real-world chat application or a shopping application. these apps will have to store data for many operation that the user will do on the application. like sending a message or commenting on a Product or Deleting/Adding/Editing a Product.
given these operation how will the datastore should look like? Surely we cannot store the Messages as /Messages/{Message,To,From,Timestamp} because many users will send a message that will have to be written to this key. an alternative is to limit a user per 1 message per second and store it in his profile /Users/{USER}/{Message,To,From,Timestamp} but then only a single user can write to this entity group. so we can put them on the root as: /{USER}/{Message,To,From,Timestamp} but is it considered a good practice? is it fast enough to query the datastore to get all messages between users? (efficient? possible?)
another alternative is to store everything in the root of the datastore as "Messages" and "Users" and "Products" and "Categories" (for example a product will have a category reference in it).
Summary
- Where can I find code-samples or design manual that are good for even millions of users?
- Am I wrong with something here?
- Any suggestions that are related to the topic?
I found these code samples but I have no tools or idea how to know if these are any good practices for scale?
Thanks!