每天推送5篇优质英文文章 · By makers, for makers

运营 1110 天, 推荐好文 4,970 篇, 原创简评 1,020,976 字, 原文总阅读时间 43,503 分钟, 138,938 人订阅

(原链接可能被墙了,打印成 pdf 放到这里 https://nfil.es/w/OWKCXl/) 这是今年 @Scale 上,Facebook 的这个 talk 的文字版。 Core Data 是瓶颈。 Core Data is at heart an object-relational mapper (ORM). It provides features like full normalization and synchronous consistency across multiple isolated contexts. But since the Facebook app is essentially a cache for data that lives on the server, a completely normalized representation of data wasn't needed. All of those fetch-or-creates while parsing JSON objects were resource-intensive and unnecessary. We developed our own bare-bones form of model objects guided by three principles:
  • Immutability. In this new data layer, models are completely immutable after creation.
  • Denormalized Storage. To serialize these models to disk, we chose to use NSCoding.
  • Asynchronous, Opt-In Consistency. By default, there are no consistency guarantees.
分享到: