黑莓|使用远程数据库保持本地Persistant存储最新

时间:2022-08-27 16:52:19

I'm developing a blackberry application to remotely access an external customer database.
Selected employees can change customer entries via a webinterface accessible in our intranet.

我正在开发一个黑莓应用程序来远程访问外部客户数据库。选定的员工可以通过我们的Intranet中可访问的Web界面更改客户条目。

I don't want the blackberry to contact the database on every request, so I built in a local storage, which stores the top 50 selected customers of the blackberry user.

我不希望黑莓在每次请求时联系数据库,所以我建立了一个本地存储,存储黑莓用户的前50名选定客户。

What the best practice to keep both records in sync? I thought about creating an hashcode of each record to reduce the datasize to transfer (and though the energy necessary to transmit it). Can anyone here tell me what they do, to reduce requests by a mobile device?

保持两个记录同步的最佳做法是什么?我考虑过创建每条记录的哈希码,以减少要传输的数据量(以及传输它所需的能量)。这里的任何人都可以告诉我他们做了什么,以减少移动设备的请求吗?

Thanks, rAyt

1 个解决方案

#1


In a couple of different situations I've added a created/modified timestamp to each record. On a successful sync with the server, you note the last server time, store it on the client, and on the next sync only get the records (if any) that have changed since the last one. This will reduce data but you may still have to deal with records that were changed on both client and server since the last sync.

在几种不同的情况下,我为每条记录添加了一个创建/修改的时间戳。在与服务器成功同步时,您会注意到上次服务器时间,将其存储在客户端上,并且在下一次同步时只获取自上一次更改以来已更改的记录(如果有)。这将减少数据,但您可能仍需要处理自上次同步以来在客户端和服务器上都已更改的记录。

#1


In a couple of different situations I've added a created/modified timestamp to each record. On a successful sync with the server, you note the last server time, store it on the client, and on the next sync only get the records (if any) that have changed since the last one. This will reduce data but you may still have to deal with records that were changed on both client and server since the last sync.

在几种不同的情况下,我为每条记录添加了一个创建/修改的时间戳。在与服务器成功同步时,您会注意到上次服务器时间,将其存储在客户端上,并且在下一次同步时只获取自上一次更改以来已更改的记录(如果有)。这将减少数据,但您可能仍需要处理自上次同步以来在客户端和服务器上都已更改的记录。