Live data from Hacker News

Show HN: Realm (YC S11), a mobile database

realm.io

71–80 of 105 posts

Re: Show HN: Realm (YC S11), a mobile database

#71

Earlier quoted context omitted.

Thanks for the kind words! Regarding wiring this to a TableViewController, we have some code samples already for Swift[0] and Objective-C[1]. Right now you get notified of changes and refresh, but we’re very interested in exposing a reactive-style binding mechanism as well. The storage engine underneath supports that very well actually, so stay tuned… [0] https://github.com/realm/realm-cocoa/tree/master/examples/swif…

The main benefit of using CoreData is seamless faulting behavior. It's not obvious from the example or the site that Realm supports something comparable. How does Realm deal with a lot of objects?

Realm does not have a concept of faulting like Core Data does. In Core Data every object is essentially a copy of a representation in the underlying data store (usually sqlite), so instantiating the object is quite expensive as all the properties have to be retrieved and copied into the object, and before you have done that it is very limited what you can do with the data.

In Realm the object you see is a direct representation of the underlying data, it does not have to copy in all the properties. When you access them, it is the property directly from the db you are getting, not a copy stored in the object. This means that it takes up a fraction of the memory space, and it also means that queries and similar operations can work on the objects directly in the db, without having to instantiate them in objective-c. This means that you can easily scan over millions of objects, without causing a single "fault".

When manually traversing objects you still have to instantiate them, but since they don't have to copy any data, it is a far more lightweight process than faulting.

Re: Show HN: Realm (YC S11), a mobile database

#73
post #24

Earlier quoted context omitted.

Core Data has been improved and stabilized by Apple for over a decade, is used internally by many first party apps in iOS, is well documented and fully integrated into Xcode, and heavily "marketed" by Apple at WWDC. Any perceived performance issues can be eliminated or reduced by using faults, indexes and improving queries through NSPredicates. Even one of the blog posts you quote above [3] states that if he was star…

Anyone using CouchbaseLite? http://developer.couchbase.com/mobile/#couchbase-lite I see a lot of comments here about wanting a CoreData replacement that's better at sync, which is exactly the use case CouchbaseLite is meant to solve.

Seriously love this product. What the Realm guys are missing is the fact that Couchbase Lite is really a replication protocol overlayed SQLite. Couchbase Lite did not always use SQLite and is in the process of switching to ForestDB as the underlying persistent store. As far as API's go, I have not seen a more intuitive design than CBL's. It almost makes too much sense. Once you get Sync Gateway setup, you have a mini iCloud. Watch the CloudKit presentations and you'll see that CBLite solves what Apple is leaving up to developers as far as Sync goes.

Re: Show HN: Realm (YC S11), a mobile database

#76
Well I think everyone agrees it looks like something pretty interesting but I couldn't find anywhere what's the easiest way of migrating from CoreData w/sqlite to Realm? Not sure if the tradeoff of rebuilding everything would be worth it for the increase in performance.

Re: Show HN: Realm (YC S11), a mobile database

#77
post #39

Earlier quoted context omitted.

The database is stored in a single file that is easily backed up. It does not have any explicit integration with iCloud, but you can easily use it to back up a copy of the db, or you can stream the copy back home yourself via ftp or http.

I'm somewhat of a newbie in regards to developing on mobile devices. Got any documentation how this is done from the phone?

I'm Kenneth at Realm. As realm databases are files on the phone's file system, you can use the common classes for manipulating them. To do a backup, the NSFileManager class might be useful (the copyItemAtURL method might be what you're looking for). See https://developer.apple.com/library/mac/documentation/Cocoa/... for details.

Re: Show HN: Realm (YC S11), a mobile database

#80
post #7
post #2

This is looking very good and it could lower the pain of developping mobile apps, especially for independent studios. Looking forward to learn more about the details of data syncing.

Data syncing is an obvious need and Realm has actually been designed for that from day one. The entire underlying core is build to seamlessly record changes and coordinate them with a backend. It is not part of the initial launch as we want to nail down the local api's with the community first, but look out for announcements soon.

What kind of consistency do you expect to provide with this future syncing feature? I assume it will be eventually consistent. Is that right? How will conflicts be resolved?
Post reply on HN