best strategy for keeping client data in synch with backend database?

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.


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


If you can't use the messaging protocol in BlazeDS, then I would have to agree that you should do RTMP polling over HTTP. The data is compressed when using RTMP in AMF which helps speed things up so the client is waiting long between updates. This would also allow you to later scale up to the push methods if the product's customer decides to pay up for the extra hardware and licenses.


您不需要Livecycle和RTMP以实现通知机制,您可以使用BlazeDS的渠道来执行此操作,并使用流式/长轮询策略

链接地址: http://www.djcxy.com/p/41758.html

上一篇: 如何在Word 2007中创建自动修订历史记录表

下一篇: 保持客户端数据与后端数据库同步的最佳策略?