使用RestKit 0.20备份核心数据 [英] Backup core data with RestKit 0.20

查看:149
本文介绍了使用RestKit 0.20备份核心数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对RestKit相当新,一般来说,使用RESTful Web服务来同步核心数据。
为了简化这一点,我决定使用RestKit只将本地存储备份到我们的rails后端。

I am fairly new to RestKit and in general with synching core data with a RESTful web service. To simplify this I have decided to use RestKit for only backing up the local store to our rails backend.

这里有两个问题我的列表中:

So here are two questions that are currently on top of my list:

1)使用RestKit备份核心数据的最佳做法是什么?
我想创建一个本地上下文,我的应用程序使用它来执行所有的fetch / create / update / delete操作(本地和持久化它们在持久存储)
然后在后台允许RestKit通过RKManagedObjectStore

1) What is the best practice for using RestKit to backup core data? I was thinking to create a local context that my apps uses to do all the fetch/create/update/delete operations (locally and persist them on the persistent store) Then in background allow RestKit via RKManagedObjectStore to do the backup using its own MOC every 5 minutes.

2)RestKit是否提供一些处理方法来在离线时重试HTTP请求?
如何管理同一实体上的本地CREATE和本地EDIT等情况?
我正在考虑使用Blake在他的一条评论中建议的创建/更新/删除标志。

2) Does RestKit provides some handles methods to retry HTTP requests when offline? How do I manage situations such as a local CREATE and a local EDIT on the same entity? I was thinking to use Create/Update/Delete flags as suggested by Blake in one of his comments.

非常感谢您的帮助!

推荐答案

直接从Blake的RestKit的创建者!

简短的答案:没有准备好与RestKit同步的解决方案(当离线时),但Blake指向一个小但非常有趣的起点 - 如果你有任何其他想法,请随时建议。我仍然在寻找最好的方法。

Directly from Blake the creator of RestKit ! ​ Short answer: there is no ready solution for sync with RestKit (when offline) but Blake points at a small but very interesting starting point - if you have any other idea please feel free to suggest. I am still looking for the best way to do this.​

Blake Watters:

Blake Watters:


  1. 我从来没有做过这样的事情。理论上你应该只能上传SQLite,但我不知道什么样的一致性保证你将有关于数据。

  2. 没有任何种类的内置机制实现这是非常难以将同步行为推广到这种级别。 RestKit给你的低级组件来实现这样的东西,有一些有趣的开源工作正在努力解决这个问题: https://github.com/eric-horacek/EHObjectSyncManager

  1. I've never done anything like this before. In theory you should be able to just upload the SQLite, but I have no idea what kind of consistency guarantees you will have about the data.
  2. There is not any kind of built in mechanism for implementing this as its very hard to generalize syncing behaviors to this kind of level. RestKit gives you the low level components to implement something like this and there are some interesting open source efforts underway trying to tackle the problem: https://github.com/eric-horacek/EHObjectSyncManager

这篇关于使用RestKit 0.20备份核心数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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