Live data from Hacker News

Show HN: Realm for Android

realm.io

11–20 of 66 posts

Re: Show HN: Realm for Android

#11
post #8

Faster, more understandable code and less disk space. It's great and I wonder how this miracle possible.

Ritual sacrifices, mostly. Just kidding ;) For the “faster” and “less disk space” parts, we use a lot of standard techniques like bitpacking, compactionless b-trees and other things that have been designed in the past 10 years — we’ll blog more about that stuff very soon. The “understandable code” part can probably be explained by the fact we focused on that extensively during implementation: we did lot of API revisions, gathered lots of feedback in private beta — and we still have a long way to go!

Re: Show HN: Realm for Android

#13
post #9

The "a replacement for SQLite & Core Data" description confuses me. Is this a SQLite replacement, in that it is its own database, or a CoreData replacement, in that it's "just" a nice API over some other persistence layer (afaik, CoreData gives you a nice consistent API over a number of concrete persistence implementations, with SQLite being one such implementation)

Hi, I wrote that tagline so maybe I can explain the rationale. We initially called ourselves “a database that runs directly inside phones, tablets & wearables” but received some ridicule for that as it sounded like we didn’t expect our readers/users to know what a mobile/embedded database was. We iterated a few times until we found this description, where we explain that we replace both low-level DBs like SQLite and high-level abstractions like ORMs or Core Data (because we have our own object-interface built in), while highlighting the two solutions we replace most often on Android & iOS respectively. I agree it’s still somewhat confusing and your analysis is spot on. We’ll try to iterate on this tagline a bit more!

Re: Show HN: Realm for Android

#15
It looks like all I/O happens synchronously, which means you generally should not run that on Android's main thread. You could just warp all interactions in AsyncTasks, but that's cumbersome. Do you consider adding an async API with callbacks on the main thread?

Re: Show HN: Realm for Android

#16
Just as a heads up your documentation doesn't work with the newest version of the Android Gradle plugin (0.13.0), see here: http://stackoverflow.com/a/25939518/472021

the `android-apt` dependency needs to be switched to 1.4 else you get:

    A problem occurred configuring project ':cachetest'.
    > No such property: projectDependencies for class: com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated
Edit #1: Is there any way to instantiate my RealmObject from JSON? I'm currently using GSON to take API calls POJOs, I can't figure out any way to do this using Realm since models "must be instantiated from the Realm using the realm.createObject() instance method".

Edit #2: Okay I have no idea how to use this. Given a list of `Object`, how do I make a `RealmList` of it? Do I have to use Realm.createObject? Is there not any way of just taking a couple already instantiated versions of an object and jamming them into a `RealmList`?

I was really excited about trying this out (the Stack Exchange app currently has a 37ms delay on a cold start to get the list of all of our sites back into active memory) but this does not look like it's going to be easy to use.

Re: Show HN: Realm for Android

#17
Given the insert speeds, I'm guessing they're (still) not reusing compiled statements. I mentioned this last time I saw Realm on the front page[1], but their benchmarks are misleading without at least mentioning that they're doing this.

I'm still very much interested in Realm, and LOVE having a competitor to SQLite. But don't mislead your customers.

[1]: https://news.ycombinator.com/item?id=8043332 where seepel finds SQLite to be more than twice as fast as Realm after that one change to the benchmark.

Re: Show HN: Realm for Android

#19
post #15

It looks like all I/O happens synchronously, which means you generally should not run that on Android's main thread. You could just warp all interactions in AsyncTasks, but that's cumbersome. Do you consider adding an async API with callbacks on the main thread?

[deleted]
Post reply on HN