0

Java EE Web アプリ (および一般的な Web アプリ) について読んでいるときに、次のような内容をかなりの回数読んだことがあります。

Web アプリは、HTTP のように自然にステートレスであるべきです

  1. これは事実上、すべてのリクエストで状態を DB からプルする必要があり、リクエスト間でサーバーに情報を保持してはならないということですか?
  2. Web アプリケーションがステートフルであることの何が悪いのでしょうか? それはどのような不利益をもたらしますか?
4

1 に答える 1

2
  1. Yes.
  2. It makes them more complex, because since multiple concurrent users modify the same state, making the app stateful quickly leads to stale or inconsistent data in memory. It also makes the app less scalable, because state consumes memory, and state must be replicated (or made available somehow) on all the web servers of the cluster.
于 2013-02-12T10:26:50.263 に答える