7 ms·
iOS 12: Core Data External Binary Data Storage Becomes Corrupt
- robin_reala 8y agoOK, I’m not an iOS developer. Can anyone explain what this means?
- saagarjha 8y agoCore Data is an object persistence framework for iOS that essentially wraps around SQL. It looks like it’s losing data when the external storage option is enabled.
- mcintyre1994 8y agoWhat does external storage refer to here? I don't think iOS has extendable storage does it? So is it eg. iCloud?
- delta1 8y agoIt appears to be "external" to the sqllite database https://forums.raywenderlich.com/t/where-is-allows-external-storage-data-actually-stored/18905 https://forums.raywenderlich.com/t/where-is-allows-external-...
- saagarjha 8y agoIf you have a large amount of data to store, instead of embedding it in-line inside the database itself you’d store it in a separate file.
- delta1 8y agoCore Data is an object graph and persistence framework [1] On iOS 12, binary data stored in Core Data with the External Storage option gets corrupted on every second save [2] [1] https://en.wikipedia.org/wiki/Core_Data https://en.wikipedia.org/wiki/Core_Data [2] http://openradar.appspot.com/44884416 http://openradar.appspot.com/44884416
- deleted 8y ago[deleted]
- philo23 8y agoCore Data is basically a layer over SQLite that turns it into an object graph database. External data storage lets you offload large binary data from being stored in the SQLite database without changing how you access that data from objects in the graph. An example might be if you're creating a photo library. Rather than storing the actual photos as say BLOB data in SQLite, you can tell Core Data to transparently store it as an external file. It then basically stores the filename and some metadata in SQLite instead, keeping the SQLite database small without changing the Core Data API to access the data.
- vbezhenar 8y agoGolden rule: don't upgrade until first sevice pack. Release date set by management, so you have to ship with whatever bugs are left. But patch is usually developed with more timely approach.
- Razengan 8y agoI reported some bugs as early as the 2nd and 3rd Developer Previews of macOS Mojave, but they’re still not fixed in the final release.
- protomyth 8y agoI’ve been reporting the same bugs in Finder since Mavericks, don’t get your hopes up that they will be fixed.
- erichurkman 8y agoFinder is the bug, unfortunately.
- Razengan 8y agoYou’d think Apple would at least want to take care of any visual inconsistencies, specially in one of the major features which are touted as the big incentives for upgrading. There are still some UI elements here and there which are out of place in Dark Mode at best, or almost illegible at worst. Such lax approach to UX polish has traditionally been associated with Microsoft, not Apple.
- jsjohnst 8y agoI reported (and had Apple engineers come to meet us) a severe bug (found and showed the engineers the single line of code in the public source code) in OSX 10.4’s wifi stack, wasn’t fixed until 10.8. Literally a single line of code.
- amaccuish 8y agoThat doesn't really work when the vast majority of iOS users upgrade so quickly. These devices mostly not in control of IT departments.
- mariusmg 8y agoThe Sqlite database becomes corrupt ?
- okket 8y agoI doubt it. The data is stored externally in the filesystem and referenced in the SQLite database. I guess something happens in the filesystem or during every second storing process, so that the metadata references become out of sync.
- londons_explore 8y agoI'd guess it's because someone isn't accessing it from a single thread, or isn't following the lifecycle requirements for storing data in an asynchronous datastore. You absolutely have to wait for the completion event for a write before issuing another write to the same key for example.
- tmaly 8y agomaybe they are using memory as a temp store and sync issues are popping up?
- aaaaaaaaaab 8y agoNope. CoreData has the option to store blobs as flat files, outside the SQLite DB. The DB only contains the metadata to locate the files. Looks like they're messing up these external files.
- machinecoffee 8y agoAnd I guess there's no way to create a transaction between the file system and the sqlite db. I've often thought that would be a useful feature sometimes - maybe something in the sqlite API could write your file, and then commit when verified on the filesystem.
- groue 8y agoI often promise myself to have a look at SQLite virtual file system API, for this very purpose, but could not yet find the guts :-)
- bsaul 8y agoWhat are the foundationDB guys doing ? After they got bought I was hoping so much that ios would get a brand new storage technology that really works well using their famous testing environment. I don't know what's wrong with core data because throughout the years it's been one of those technology that are both unconvenient AND regularely unreliable.
- aaaaaaaaaab 8y agoFoundationDB on an embedded device? That's certainly an unorthodox approach, but I don't see the use case... On why Core Data is inconvenient: it's as inconvenient as any ORM framework in general. http://blogs.tedneward.com/post/the-vietnam-of-computer-science/ http://blogs.tedneward.com/post/the-vietnam-of-computer-scie...
- bsaul 8y agoNot the tech itself, but the people that built foundationDB surely know a thing or two about reliability and building a modern DB api. Also, you're mentionning ORM, but relying on a relationnal database as the underlying storage layer for objects doesn't have to be.