Scalable realtime application

How can I scale my realtime application?
If I store the application’s state in something like memcached, will updating the state from another thread cause any problem?
And how can I push? Do I have to build some shardable non-blocking connection server to hold the connection?

For multi-threaded applications, please see
this sticky
. It is a good explanation of the problems and workarounds.
There are in the directory several plugins to handle push
(see here)
, check the doc for each of them for more details.

As for state, you should take a look at
this part of the book
this wiki article
. While they are not directly aimed to solve your problem they go over lots of “do and don’t” with the application state data.

I have successfully built an realtime application with spring and ICEPush.
My previous project didn’t have the scalability requirement,
so I store conversational state in session scope spring bean, a list of applications in singleton scope bean.
I also overused ThreadLocal for BeanUtil and Blackboard.
I’m thinking of define some custom bean scope for spring (to store state in memcached instead of session for example).

I’m just wondering if it scales. And is it poorly designed?