Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Implementing Singleton in clustered environment

 
Sriram Sharma
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, I am not sure if I am posting my query in the correct forum.
If I need to change to a different forum, please let me know and I shall do the same.

How do we implement a singleton design pattern in a clustered environment?
This was an interview question for which I did not have an answer.
I understand singleton design pattern and the double checked locking as well.
Could someone explain me how we could implement Singleton in a clustered environment?

Regards,
Sriraam
 
Steve Luke
Bartender
Posts: 4181
21
IntelliJ IDE Java Python
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you can, (different JVMs means impossible to share same instance). And I think it would be a waste of time to try. Instead, you need to understand what requirement led to the 'need' for Singleton, then try to match that requirement rather than match the implementation. Read WhatNotHow as it pertains to this very nicely.
 
Devendra Katiyar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Check the below Link

http://www.techspot.co.in/2009/07/singleton-in-cluster.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic