GAE/J : Development and Production Environment

2019-03-31 14:40发布

What are GAE/J key differences between development and production environments.

  • What should be rechecked at production?
  • What kind of datastore differences should I expect?

4条回答
我欲成王,谁敢阻挡
2楼-- · 2019-03-31 15:10

There are many differences between Development and Production environment and you should be aware of all of them before designing your application; it's useless to say that the Development server is a "toy" (no indexes, single threaded), compared to the complexity/awesomeness of the distributed Production environment.

Here are some of the problem you would find just on the Production environment:

  1. Deadlines (30 sec per requests, 10 min for taskqueue, 10 sec max for Urlfetch)
  2. Contention when updating entities
  3. Object too large exceptions when trying to store or pass something too big
  4. Transient errors for the distributed nature of the environment (timeouts)

In general, every time there's a documented constraint (timeouts-quota) on the API, the same constraint is relaxed on the Development environment; be prepared to write a lot of defensive code.

Viceversa, the Development server, even enabling Sqlite, has serious limitation when trying to store/update thousands of entities; the Production server is a powerful beast.

查看更多
萌系小妹纸
3楼-- · 2019-03-31 15:19

Performance on dev (understandably) has absolutely no relation to production. Cold-starts are not an issue in development.

Storing particularly large amounts of data on the dev server can get problematic, and you may have to switch the development server's datastore to sqlite.

Email sending with javamail is not testable on development.

The oauth and users APIs are only minimally implemented on development.

Cron jobs don't execute on development and have to be manually triggered.

I'm pretty sure the exploding index problem will not bite you on development, its a fun one to blunder into after uploading to production.

I've had perfectly acceptable JDO code that runs on dev throw in production, (persistall()). Persisting each object individually then worked.

Just a few things from my experience, I'm sure there's more.

查看更多
再贱就再见
4楼-- · 2019-03-31 15:19

Apart from those mention above I found one more difference. In dev environment you can store non-serializable classes and objects in session attributes. But be careful to store only serializable classes on production in session attributes else you will get exception.

查看更多
萌系小妹纸
5楼-- · 2019-03-31 15:25
  • Development environment is single threaded
  • No request timeout
  • No exploding index, infact dev env does not use indexes at all for queries
  • No async URLFetch
  • No async Datastore
  • Obviously no request statistics / log searching interface
  • No wait time for index building
  • No datastore timeouts
  • No reduced capabilities
查看更多
登录 后发表回答