|
|
|
|
|
by nupark
5562 days ago
|
|
Shared memory makes perfect sense for a webapp, too. I question the whole stateless mantra -- if state is reconstructable on other nodes, then what is wrong with state that improves performance -- such as caching. Everything from database connections to user data can be cached locally, shared across connections, and does not require multiple processes each with their own large heap. I'd like to elaborate on more examples (such as comet and efficient handling of a large number of blocked connections while allowing unblocked connections to proceed concurrently while maintaining cached local state) ... But I'm on an iPad and this keyboard is driving me crazy. |
|
But I think caching is something best done in system/platform code, not in your application.
Like you say, there are plenty of examples where sharing state makes sense. But I still believe that state in application code is something that be avoided, and that most of the time it's best to rely on platforms that do state management for you.
For example, session support in web platforms is a great example of something that supplies (simulated) state, and is supplied by the platform.