Caching your data in your application code is generally a good idea for many reasons. We have being doing this for quiet some time in our shared environment which includes ColdFusion, .NET, and PHP. However, because we share this environment with many other development groups in our organization, there is significantly more downtime then we (or our customers) appreciate.
Therefore, our web admins are moving to implement a new environment. In this environment they are adding a QA level between the current Dev and Prod environments. Also, to increase uptime, they are clustering machines at both the QA and Prod level.
This is all great for many reasons. The one area where I see a problem is with caching. There will be two (or more depending on the number of nodes) sets of cache. As you can imagine, this creates the following potential problem. Cache is the same on node A and B. User 1 updates data and thus cache is updated on node A. User 2 comes to query data but is on node B and therefore get s the old data.
Are their any best practices on how to handle this?
Is there any type of change I can make in my code?
Are there server settings that can be implemented?