Here is a checklist of things that need to be done to write good application which would work in Cluster enviroemnt
- When accessing the cluster from outside using HTTP or RMI verify that access to the cluster is done throught load balancer, this can be either software or hardware load balancer.
- Consider using 'Optimistic Locking' or 'Pemisitic Locking' if two or more clients may update the same row in the databse at the same time
- If you want to cache data all over the cluster and not on a single server then don't use Singleton, you would need to user Cache framework such as GigaSpaces or OSCacheor JCache etc', this solution is good mainly for read only data or data which is mostly read.
- In many application servers you can configure your MDB if it would run on a single server or on several servers.
- Avoid reading files/writing to files in the code, Since you may run on different hosts in the cluster and the files may not exists on the current host which you are running
- Use Synchronize where two threads may access the same data at the same time, This problem can also occure on non cluster system.
Please comment if you have other issues which are missing.