Sample Google App Store App Store

Problem

After days of reading documentation on the application engine and data warehouse, I couldn't figure out how to create a scalable real-world application.

and I could not find good examples for best practice. Of course, I can make my application work, but I can’t know if it’s good to scale more than my development environment can provide.

he clearly points to a guide to using the application using the data warehouse : “However, the speed with which you can write to the same group of persons is limited to 1 entry per group of entities per second . When you develop a real application, you need to remember this fact . "

Assumptions

I assume that I understand (please correct me if I am wrong) that, given the root of the data store, / then / Users / * (Keys) is an entity group and / Products / Beauty / * is an entity group that runs the previous limit of 1 record per second. (Is / Products / Beauty / * limited / Products / * also?)

Did I miss this?

Example

Suppose we want to create a real world app or a shopping app. these applications will need to store data for many operations that the user will do in the application. for example, send a message or comment on a product or delete / add / edit a product.

Given this operation, what will the data warehouse look like? Of course, we cannot store messages as / Messages / {Message, To, From, Timestamp}, because many users will send a message that must be written to this key. an alternative is to limit the user to 1 message per second and save it in his profile / Users / {USER} / {Message, To, From, Timestamp}, but only one user can record this group of entities. so we can put them in the root like: / {USER} / {Message, To, From, Timestamp}, but is this considered good practice? Is it fast enough to request a data store to receive all messages between users? (effective? maybe?)

Another alternative is to save everything in the root of the data warehouse “Messages” and “Users” and “Products” and “Categories” (for example, the product will have a link to a category in it).

Summary

  • Where can I find code samples or design guidelines that are good even for millions of users?
  • Am I something wrong with this?
  • Any suggestions related to the topic?

I found these code examples, but I have no tools or ideas, how do I know if they are good examples of scale?

Thanks!

+6
source share
2 answers

Typically, a group of objects is used only when you need transactions and / or strong consistency for objects in the same group. And the data warehouse does not give a “root”.

Take a look at the photo app as an example. When you add a new user, each user object becomes its own "entity group" because it does not (and does not require) a parent object. This means that you can add as many users per second as you want.

When you add a new photo album, you can either make it a child of a user object, or add it without specifying a parent object and simply refer to the user in one of its properties. And if you decide to use the relationship between parents and children between users and photo albums, you will be limited to adding one album per user per second. In a real situation, the user cannot quickly add albums.

App Engine is built with scalability as a key feature. Start building your application or study one of the tutorials / sample applications, and many of these data modeling concepts will become clear.

+5
source

You think about it wrong. Key paths will not be / Users / * (Keys)

But the set of keys ('User', somekey), the user in this case is Kind (representing the type of entity). In this case, each entry is the root of its own group of entities.

You would only keep deep key chains (ancestors), where you have very strict requirements for relations with the owners.

I have an application with over 2000 users. And course material. Each user is his own group of people, owning his own results, with key links to the course material. Each course belonging to the training object is in one group of people (there is no requirement for the recording speed hi), and we see no reason why it will not be scaled for millions of users. Performance improved significantly when we switched from 100 → 2000 users.

+5
source

Source: https://habr.com/ru/post/970299/


All Articles