A friend of mine just replaced Realm in his

October 14, 2021, 3:42 am
A friend of mine just replaced Realm in his
A friend of mine just replaced Realm in his app with SQLite.swift. The iOS binary dropped from 140MB to 23MB. The macOS binary dropped from 324MB to 54MB. That is astonishing.

So surprised to learn that Realm is a sow. SQLite is pretty lean and easy to use, if you understand SQL and databases at all. Not forcing an ORM into everything is one of the better things you can do for your sanity.

Wow! Very interesting. I was not a fan of Realm and its mutable models. Havent tried out SQLite.swift but have used since, and I have really enjoyed it. Well, as much as one can enjoy a storage solution. Might be a bit polarizing with its use of code generation.

I use SQLite.swift and my binary is like 2MB, but my database is only around 10,000 rows.

Always thought Realm was really impressive but never had a use for it. Even now I often just use the filesystem and Codeable. Sqlite can compliment it well.

Darn, this is nuts! I barely see how it`s even possible .

How did he go about the transition? Dont you need to keep Realm around to migrate to the new version? Ive never understood how you can do that

This doesnt sound right. Realm is small enough to work inside an App Clip.

Its honestly not too much of a surprise. Even with that drastic of a drop, Realm has a heft 15mb buy in at the door. Its the first thing I rip out of an app Im working on when I see it as its value is only in 2 or 3 features most apps dont use.

I would be interested to hear how much the build times reduced by too!!

Are they shipping with a pre-populated database? Im moving away from it very soon without a replacement library, so I just tested this, and my exported binary only drops by ~25mb. The version of the app that users download from the App Store is only 28mb with Realm.

On one hand, yeah, but isnt that kind of like saying I removed all the images and video from my website and converted to plain text and it got smaller? Yes but youre giving up non-trivial functionality (without passing judgment on whether the specific tradeoff is warranted)

Whoa thats awesome!

I guess thats the fat binary with Bitcode?

Sounds very difficult to believe I have many production iOS apps using Realm, with binaries under 40MB.

Thats unusual high. Your friend did definitely something wrong when he added Realm/RealmSwift.

Not to me, it isnt.

Oh man that is nuts!

Moving from Realm to Core Data dropped one of my apps from 13MB to 2MB. Not as huge of a change, but still nice seeing the reduction regardless.

Huzzah! Free up our phones!

I am using SQLite.swift for like two years. Its a great thing. When used with sqlite migration manager and a little bit of fine tuning I dont have any problems with it.

 
Sponsored links