R – Flex – best strategy for keeping client data in synch with backend database

apache-flexblazedsremoting

In an Adobe flex applicaiton using BlazeDS AMF remoting, what is the best stategy for keeping the local data fresh and in synch with the backend database?

In a typical web application, web pages refresh the view each time they are loaded, so the data in the view is never too old.

In a Flex application, there is the tempation to load more data up-front to be shared across tabs, panels, etc. This data is typically refreshed from the backend less often, so there is a greater chance of it being stale – leading to problems when saving, etc.

So, what's the best way to overcome this problem?

a. build the Flex application as if it was a web app – reload the backend data on every possible view change

b. ignore the problem and just deal with stale data issues when they occur (at the risk of annoying users who are more likely to be working with stale data)

c. something else

In my case, keeping the data channel open via LiveCycle RTMP is not an option.

Best Answer

a. Consider optimizing back-end changes through a proxy that does its own notification or poling: it knows if any of the data is dirty, and will quick-return (a la a 304) if not.

b. Often, users look more than they touch. Consider one level of refresh for looking and another when they start and continue to edit.

Look at BuzzWord: it locks on edit, but also automatically saves and unlocks frequently.

Cheers

Related Topic