iPhone SQLite DB和基于网络的DB同步和互动建议[英] iPhone SQLite DB and Web-based DB synchronization and interaction recommendations

本文是小编为大家收集整理的关于iPhone SQLite DB和基于网络的DB同步和互动建议的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我正在开发第二个iPhone应用程序,并正在寻找DB处理的建筑建议.

这个想法是: 1.信息数据库存储在服务器(LAMP堆栈)上,并通过JSON将信息传递到设备.该部分已实施.

  1. 用户能够在数据库中"喜欢"一个项目,该项目将其存储在其本地设备上.

  2. 用户还可以向尚未存在的远程服务器提交新项目,使其可供其他用户使用.

  3. 用户可以通过单个搜索接口搜索两个数据库以查找项目.

我正在尝试为此决定数据结构,以及如何处理数据库中所得的对象.我想我有两个选择:

  1. 远程数据库和本地数据库具有相同的对象类型,本地数据库存储远程项目的ID,以链接两个

  2. 远程项目和本地项目的单独对象

任何想法,思想等都非常感谢!

推荐答案

您需要编写自己的同步引擎.我在我从Wine Journal应用程序中撰写的记录级,历史驱动的同步引擎上发布了一系列笔记,您可以在这里找到……

http://blog.deeje.tv/musings/2009/06/notes-on-writing-a-history-driven-client-client-server-server-synchronization-engine.html

其他推荐答案

如果要在数据库中具有同步对象,则可以使用修改时间戳比较和哈希列的组合来确定哪些记录是陈旧的,需要更新.

>

其他推荐答案

如果您正在寻找现有的API,那么QuickConnectFamily Framework具有使用JavaScript在UIWebView中使用JavaScript在浏览器和已安装的SQLITE数据库中工作的框架.我也接近为那些不编写混合应用程序的人提供纯粹的Objective-C实施.

JavaScript版本也适用于Android.

http://www.quickconnectfamily.org

本文地址:https://www.itbaoku.cn/post/597596.html

问题描述

I'm in the process of developing my second iPhone application, and am looking for architectural recommendations on DB handling.

The idea is: 1. A database of information is stored on a server (LAMP stack), and information is delivered to the device via JSON. This part has been implemented.

  1. The user is able to "favorite" an item in the database, which stores it in SQLite on their local device.

  2. The user can also submit new items to the remote server that don't already exist, making them available for other users to favorite.

  3. The user can search both databases, via a single search interface to find items.

I'm trying to decide the data structure for this, and how to deal with the resulting objects from the database. I think I have two options for the objects:

  1. The remote DB and the local DB have the same object type, and the local DB stores the id of the remote item to link the two

  2. Separate objects for the remote item and the local item

Any ideas, thoughts, etc are greatly appreciated!

推荐答案

You'll need to write your own synchronization engine. I posted a lengthy set of notes on a record-level, history-driven synchronization engine I wrote from a wine journal application, which you can find here…

http://blog.deeje.tv/musings/2009/06/notes-on-writing-a-history-driven-client-server-synchronization-engine.html

其他推荐答案

If you want to have synchronized objects in the databases, you could use a combination of a modification timestamps comparison and a hash column to determine which records are stale and need to be updated.

其他推荐答案

If you are looking for an existing API the QuickConnectFamily framework has one that works within the UIWebView using JavaScript for both in browser and installed SQLite databases. I'm also close to having a pure Objective-C implementation for those that aren't writing hybrid apps.

The javascript version also works for Android.

http://www.quickconnectfamily.org