54miracle
V2EX  ›  iDev

吐槽一下 Realm

By 54miracle at 2015 年 4 月 17 日 · 5705 次点击
之前调研过Realm,看是Ycombinator创业营出品,产品迭代也挺快,感觉应该挺靠谱。 就在新项目中准备用一下,试用了几天还是发现有好多坑。

像Realm这样有数据库格式,到应用层API的第三方库,即使更新迭代快,增加一个数据层格式的支持也是需要很长的周期。 选择得慎重

还有在使用的V友么,一起讨论下。

官网: http://realm.io/
第 1 条附言  ·  2015 年 4 月 17 日
Realm设计的初衷是为了实现一个更适合移动终端的database系统,比如在oc上,相比SQLite,API的封装更友好更方便,相比CoreData,性能会更好。

但是这样的库要做到比较成熟,可能得等到2.0版本,现在还没有发1.0版。

刚用了两天,就遇到了暂时不支持model字段对应值为null、没法设置primary key为auto increment的问题。再考虑要不要换成SQLite。
7 条回复  •  2015-10-09 15:21:27 +08:00
arbipher
   1
arbipher  
   2015 年 4 月 17 日
有那些坑啊楼主分享一下?
PrideChung
   2
PrideChung  
   2015 年 4 月 17 日
刚出的时候我也是打了鸡血一样了,一直在等类似NSFetchedResultsController的功能,后来等到没爱了就没关注了。
yichen
   3
yichen  
   2015 年 4 月 17 日
从去年7月份发布就开始关注了,优点是速度快,API的设计简洁。不方便的是migrate需要手写,长期维护下来是问题。
allan1st
   4
allan1st  
   2015 年 4 月 18 日
我用的 JAVA 版,又一些一样的问题:
不能为 null (自己写 getter 可以解决);migrate 不友好;还有不支持 JSON 格式中的 String/Integer Array 。
最关键一点是只能在同一线程 query 和使用(虽然速度很快,但是我怕数据库大了还是要卡界面)。
beeender
   5
beeender  
   2015 年 10 月 9 日
@allan1st Realm 刚刚发布了对 null 的支持,见 https://realm.io/news/realm-java-0.83.0/ 异步 query 的支持也将很快发布,可以关注这个 PR https://github.com/realm/realm-java/pull/1214
allan1st
   6
allan1st  
   2015 年 10 月 9 日
@beeender 非常感谢!
allan1st
   7
allan1st  
   2015 年 10 月 9 日
@beeender 最近尝试找一些替代,发现 Storio 也不错。支持 RxJava 。 https://github.com/pushtorefresh/storio
iOS 开发实用技术导航
NSHipster 中文版
› http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
› http://www.cocos2d-iphone.org/
CocoaPods
› http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
› http://code.google.com/mobile/analytics/
WWDC
› https://developer.apple.com/wwdc/
Design Guides and Resources
› https://developer.apple.com/design/
Transcripts of WWDC sessions
› http://asciiwwdc.com
Cocoa with Love
› http://cocoawithlove.com/
Cocoa Dev Central
› http://cocoadevcentral.com/
NSHipster
› http://nshipster.com/
Style Guides
› Google Objective-C Style Guide
› NYTimes Objective-C Style Guide
Useful Tools and Services
› Charles Web Debugging Proxy
› Smore
© 2026 V2EX · 36ms · 3.9.8.5