سؤال

Two questions about updating my domain diagram:

1) I am new to GAE and have just deployed my first application based on Objectify. Just to discover than soon after my first users came in I had soon gone through the datastore read quota limit:

snapshot fron datastore viewer

I had not until now put too much thought on server side caching. I thought Objectify's session cache would do the job for me. But now I realise I need use the global memcache.

According to Objectify's doc, I have to use Objectify's @Cache annotation on every entity that is accessed by key (and not by query).

However I am concerned about the side effects this will have on data that I have already stored in datastore.

2) I also realize now that I am using @Parent too much. There are a couple entities were using @Parent has no benefit (and it has some drawbacks due the datastore limiting write operations on entities belonging to the same root).

If I go ahead and remove the @Parent annotation from the entities of my domain where it no longer is needed, will it have side effects on the already persited entities?

Thanks!

هل كانت مفيدة؟

المحلول

  • For objectify : the global cache is enabled by default, however you must still annotate your entity classes with @Cache.
  • @Parent is important if you need consistent result, and avoid eventual consistency. Removing the ancestor will have a side effect on the already stored data as the key will change. You will need a migration plan.

But most of all, the free quota are quite reasonable, so if you already run into quota errors with your first user, then I would suggest installing appstats and actually measure what is the real underlying cause i.e. what action(s) are responsible for the bulk of the operations and work on those. Much better than a general approach.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top