1/21/19: The solution to all of the crashes

Liam Bolling
Ellie Calendar
Published in
2 min readJan 21, 2019

So this past week I’ve been struggling with figuring out how to prevent crashes that are a result from CoreData and concurrency violations.

This is kind of a big issue because I’m finding as I scale Ellie Calendar that around 0.5% of users find a crash everyday directly resulting from this. At a small scale it’s not bad, but I find most user’s don’t come back after a crash. So it’s high priority.

I found a ton of resources on Google such as Pawan Poudel’s amazing post on how to deal with this crap but I find myself in two situations: either the data saves but my user’s event notifications are duplicated multiple times, or the data just doesn’t save.

For context, the data I save locally for Ellie Calendar is mainly references to existing calendar events and reminders. Not a heavy amount of data, but it needs to write synchronously for now while I do the logic on the timeline (find free time, give suggestions, merge data source, etc) and the kicker is that I need this stuff to run in the background on multiple threads to distribute the load. This will be more optimized in the future once I find free time.

So after a week of banging my head against the wall and trying to read more into my buddy’s advice (Ken Ackerson) on how CoreData is difficult, I switched the whole app over to Realm.

This is my official “I give up on CoreData” post, so this past week has also been me working on converting over to Realm, which seems to be the best alternative. So far it’s been heaven compared to CoreData so we’ll see how next week goes.

Weekly Updates: This is part of my weekly updates on making a modern calendar called Ellie. It might include super technical stuff, product decisions or design challenges.

--

--

Liam Bolling
Ellie Calendar

Liam Bolling is a Product Manager and startup founder with a background in tech companies such as Google and Microsoft. See more at https://www.liambolling.com