@alon yes I'm managing my keys. I had read updating an entity was expensive (now I'm not sure if by updating, they meant "put").
Probably as @Tim says, updating would mean a get and then a put. So, I guess if I'm managing my keys and I don't care about old data, doing a "put" would be a good option. -N On Sep 20, 5:18 pm, Tim Hoffman <[email protected]> wrote: > Alon > > On Sep 20, 8:07 pm, alon <[email protected]> wrote:> actually i read the > basic rule of app engine is that PUT is the most > > resource extensive job you can do and should avoid it at all cause :) > > Correct. (well actually a big query is way more expensive than > putting one entity ;-) > > > Also correct me if im wrong, but in order to update you need to query > > to get the object itself, how can you update an object without pulling > > the data before hand? or are you managing your keys? > > There is no update in appengine, you get() or put() . An update > is get(), modify properties, put() writing the whole entity on each > put. > > And yes you would need to manage keys if you are just doing puts, > hence my question "do you care about old data" > > > Come to think of it. overwrite will require the same. im guessing it > > wont make a difference in performance. > > overwrite is just a put, but get + put is more expensive. Especially > if you don't care about the old data. > > T > > > > > On Sep 19, 2:41 pm, nischalshetty <[email protected]> wrote: > > > > Ah, that's a good point. Ok, so if I don't care about the existing > > > data, I can simple overwrite them without worrying. I hope its the > > > case if say I have like 50 million entities? > > > > -N > > > > On Sep 19, 4:16 pm, Tim Hoffman <[email protected]> wrote: > > > > > Hi > > > > > That all depends on if there is any data in the old entity that you > > > > want to copy to the overwritten > > > > entity. If not it will be cheaper to do a put rather than a get > > > > followed by a put. > > > > > T > > > > > On Sep 19, 2:03 pm, nischalshetty <[email protected]> wrote: > > > > > > When I started out, I made a few of my entities without the appengine > > > > > "Key" as primary key i.e. made them with numeric primary keys. > > > > > > Then I moved on to using "Key" as a primary key for my entities. In > > > > > the documentation it says if we try to persist an entity with an > > > > > already existing key, it'll overwrite the existing record. > > > > > > So, my question is, to update my entities, should I just overwrite > > > > > them or should I do the traditional, get entity, modify it and then > > > > > call the update method to persist it? -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
