O'Reilly logo

Mastering Google App Engine by Mohsin Shafique Hijazee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modeling your data

Now let's model something that will explain how keys work. We have a Kind named Listing, which will be used to create listings. However, there is no way for us to put various listings in different categories as yet. How do we do that? There are two approaches.

The first approach – storing a reference as a property

The first approach is pretty simple and is known to us from the RDBMS world. We can create categories separately, and each category will have a reference in each listing. It is similar to how foreign keys work in databases. So, we will have a new property for the Listing entities, which will contain a reference to the category to which it belongs. The category attribute will actually contain the key of an entity of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required