Is Flex the best strategy for keeping client data in sync with the database?

In an Adobe flex applicaiton using BlazeDS AMF remote access, what is the best strategy for saving local data and synchronizing with the database?

In a typical web application, web pages update the view every time they load, so the data in the view is never too old.

There is a problem in the Flex application with loading more data forward for sharing between tabs, panels, etc. This data, as a rule, is updated less frequently from the backend, so there is a high probability that it is out of date - it leads to problems when saving, etc.

So what is the best way to overcome this problem?

but. create a Flex application as if it were a web application - reload the backend data each time you change the view.

b. ignore the problem and simply solve problems with outdated data when they occur (at the risk of annoying users who are more likely to work with outdated data).

from. something else

In my case, saving a data channel through RTC LiveCycle is not an option.

+7
flex remoting blazeds
source share
7 answers

but. Consider optimizing background changes through a proxy server that runs its own notification or check: it knows if any of the data is dirty and will quickly return (a la a 304) if not.

b. Often users watch more than they touch. Consider one update level for searching and another when they start and continue to be edited.

Look at BuzzWord: it locks when editing, but it also automatically saves and unlocks often.

Greetings

+2
source share

If you cannot use the messaging protocol in BlazeDS, I must agree that you should do RTMP polling over HTTP. Data is compressed when using RTMP in AMF, which helps speed up the process, so the client waits a lot of time between updates. It will also allow you to scale up to push methods in the future if the product client decides to pay for additional equipment and licenses.

+1
source share

You do not need Livecycle and RTMP to have a notification mechanism, you can do this using channels from BlazeDS and use a streaming / long polling strategy.

+1
source share

In the past, I went with the choice of "a." If you used remote objects, you could configure some cache-style logic to synchronize them at the remote end.

Sam

0
source share

Can't you use RTMP over HTTP (HTTP polling)? This way you can still use RTMP, and although it is much slower than real RTMP, you can still update this file.

We have an application that uses RTMP to signal insert, update, and delete, simply sending RTMP messages containing a Table / PrimaryKey pair, leaving the application to automatically update data. We do this through Http using RTMP.

0
source share

I found this article on synchronization:

http://www.databasejournal.com/features/sybase/article.php/3769756/The-Missing-Sync.htm

It is not included in the technical details, but you can guess what coding will implement these strategies.

I also don't have trendy notifications from my server, so I need synchronization strategies.

For example, I have a list of companies in my modelLocator. It does not change very often, it is not large enough to consider pagination, I do not want to reload it (removeAll ()) for each user action, but still I do not want my application to crash or update corrupted data if it was UPDATED or removed from another application instance.

What I am doing now is storing a SELECT datetime SESSION. When I return to update the data, I select WHERE last_modified> $ SESSION ['lastLoad']

This way I only get rows changed after loading the data (most of the time, 0 rows).

Obviously, you need to UPDATE last_modified for each INSERT and UPDATE.

For DELETE, this is more complicated. As the guy noted in his article: “How can we send a post that no longer exists”

You need to tell flex which item it should remove (for example, by identifier) ​​so that you cannot DELETE DELETE :)

When a user deletes a company, you do an UPDATE instead: deleted = 1 Then in the updated companies, for the line where deleted = 1, you simply send the identifier back to flex so that it assures that that company is no longer in the model.

And last but not least, you need to write a function that clears the lines where deleted = 1 and last_modified are older than ... 3 days or whatever you think is necessary.

It’s good that if the user mistakenly deletes a row, he is still in the database, and you can save it from the real deletion for 3 days.

0
source share

Instead of caching on a flexible client, why not do caching on the server side? Some reasons

1) When you cache the data on the server side, centralize it, and you can make sure that all clients have the same data state.

2) On the server side, there are much better options for caching, not flexible. You may also have a cron job that updates data based on a specific frequency every 24 hours.

3) Since the data is cached on the server and there is no need to extract it from db every time, communication with flex will be much faster

Regards, Tejas

0
source share

All Articles