--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
Just store "DepartmentName" directly as a string on your Employee model.
In a RDBS you traditionally 'normalize' - mainly to reduce database size.
In appengine and the datastore, you denormalize. Disk-space is 'cheap'
so duplicating the string in every record is not really an issue.
http://en.wikipedia.org/wiki/Denormalization
Appengine is based on the premise of write once, read many, to making
your queries 'lightweight' is important too. Completely eliminating a
join makes the query much quicker to run.
(unless you need to query on DepartmentName then you should make it as
not-indexed, otherwise it will eat up space in the indexes)
Hi Barry Hunter!
If the user wants to change the Department? How should it be? Change the name from all Employee?
Thanks very much for this discussion!
Yes you will have to loop though all employees in the department and
change the records.
But I imagine its a pretty rare event, how often does a department
change? So performance isnt a issue. Just run a batch job. Maybe a
task, using a cursor to fire a continuion task if still more.
I didn't know that is the best practice. Thanks.
But If two users change the same Department name in the same time. A transaction with cursor in a task will ensure a consistent change?
In my application i have assign the Department id (key) to the employee instead of its name. When i retrive all the employeers, i get each Department object by its id assigned to the employeer in a for loop. Then i assign Department 's name to the Employee transport object that will be send to the interface. Did u understand? Is it correct if Department's name is change a lot ( suppose that is)? Or there is a better way?
Thanks for the fast response and clear answer.
Denormalizing does not mean you can't have a Department kind. Personally when I've got something like a department I use an entity to store the canonical name. I denormalize things like names to make queries perform well, but I also keep a reference property referencing the canonical department entity. it makes updating the department name super easy.
Robert
Denormalizing does not mean you can't have a Department kind. Personally when I've got something like a department I use an entity to store the canonical name. I denormalize things like names to make queries perform well, but I also keep a reference property referencing the canonical department entity. it makes updating the department name super easy.
Robert
On Jun 17, 2011 9:45 PM, "Renan Mobile" <renan...@renanmobile.com> wrote:
--You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.