iPhone SQLite DB和基于Web的数据库同步和交互建议 [英] iPhone SQLite DB and Web-based DB synchronization and interaction recommendations

查看:128
本文介绍了iPhone SQLite DB和基于Web的数据库同步和交互建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发我的第二个iPhone应用程序,并正在寻找关于数据库处理的建筑建议。



这个想法是:
1 。信息数据库存储在服务器(LAMP堆栈)上,信息通过JSON传递到设备。


  1. 用户可以收藏数据库中的项目,


  2. 用户还可以向远程服务器提交尚不存在的新项目,使它们可用于


  3. 用户可以通过单个搜索界面搜索这两个数据库。 b

我试图决定数据结构,以及如何处理数据库中的结果对象。我想我有两个对象的选项:


  1. 远程数据库和本地数据库具有相同的对象类型,


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


非常感谢任何想法,想法等。

解决方案

您需要编写自己的同步引擎。我在一个记录级别,历史驱动的同步引擎上写了一个长的记录,我从一个葡萄酒期刊应用程序,你可以在这里找到...



http:/ /blog.deeje.tv/musings/2009/06/notes-on-writing-a-history-driven-client-server-synchronization-engine.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

这篇关于iPhone SQLite DB和基于Web的数据库同步和交互建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆