title: How to make the Spring bean singleton in distributed environment?
body: <p>I am learning Spring, and I know that bean will be by default singleton in one application context.But what if we deploy the applications in distributed system? What will be the practical way to achieve singleton since every time a request comes in, it may be routed to a different machines with a different application context?</p>
  
  <p>I have read <a href="https://stackoverflow.com/questions/1194129/singleton-in-cluster-environment">Singleton in Cluster environment</a> but the answer is about cache.</p>
  
  <p>I guess we can do something like putting the singleton into a central place(like memcached) , and every time we need this bean and serialize and deserialize it from IO, Does this work? But, in my opinion,  this will be cost a lot since some object is very "expensive" to transfer.</p>
  
  <p>Thank you!</p>