zero copy architecture bitpacking reduces memory usage up to 90% caching and vectorization makes it faster than native C universal data representation from multiple languages Photo by Natalie Lucier https://flic.kr/p/6vUu56
Realm as network cache for all data “I don’t have any plans to go back to Core Data anytime soon. I really like Realm” sebastiandobrincu.com www.beanflow.com
We haven’t migrated anything yet, so oldSchemaVersion == 0 if (oldSchemaVersion < 1) { // Nothing to do! // Realm will automatically detect new properties and removed properties // And will update the schema on disk automatically } }];
(oldSchemaVersion < 1) { // The enumerateObjects:block: method iterates // over every 'Person' object stored in the Realm file [migration enumerateObjects:Person.className block:^(RLMObject *oldObject, RLMObject *newObject) { // combine name fields into a single field newObject[@"fullName"] = [NSString stringWithFormat:@"%@ %@", oldObject[@"firstName"], oldObject[@"lastName"]]; }]; } }];
writes the query, builds object graph, overhead there. For us, running the query builds up an array of row indexes. None of the data is loaded until you access it. Whats the difference between Realm & faulting exactly? In Core Data after faulting, when you access the object it fully loads and caches the object. With Realm we lazy load each value as you read it. How do we handle binary data, like optimization with images? We don’t do anything with that, we also don’t recommend storing large amounts of binary data in a realm What happens when you run out of storage while doing a migration? Full ACID guarantees, so the migration will fail and data is safe in its existing state, not overwritten