When I first went full-time on PrayerMate back in 2016, one of the very first major projects I tackled was to implement data syncing between devices. I hated every minute of it, and whilst the implementation mostly worked in most situations, there was a frustrating number of edge cases where it failed fairly spectacularly in unpredictable ways. It was remained one of our biggest sources of bug reports ever since – but, until now, it has seemed an impossible problem to untangle. Where do you even begin, trying to approach a problem like this?
Our old sync implementation was built on top of Firebase Real-time Database – something that was never really intended for our use case. We had separate native implementations on both iOS and Android, which was another major source of bugs, due to minor discrepancies in how they were implemented. I also often felt hampered by our commitment to building an app that could be used completely offline, and that supported anonymous usage where none of your data was synced to the cloud.
Then we discovered PowerSync. PowerSync describes itself as a “local-first” sync engine. It had a Flutter API, meaning that we could build a single implementation that worked across both iOS and Android. And it was completely designed with our use case in mind – building apps where the local database was considered primary, that worked fully offline – but then syncing that data to the cloud.
Our experience with PowerSync has been incredibly positive. They have an amazing array of demo projects that helped us understand how to implement many of the different use cases we wanted to support. Their customer support has been exceptional, answering any of our questions promptly and thoroughly. They also have an active Discord server where we could get help when we needed it.
But most importantly: it just works. When you add data on one device and see it appear on another, it really is magic. It also supports attachment syncing, and we’ve been able to rig up the same solution for data encryption that we had running in our old system too. Of course there’s been a HUGE amount of work dealing with all of the edges cases (what happens when you sign in for the first time, what happens when you sign in on a second device or an existing account, what happens when you sign out, and so on and so on…) and we have still not yet managed to reimplement ALL of the functionality of the old app in the new system (“Groups” support being the most obvious omission right now) but we are getting there, little by little, and the systems that we HAVE rebuilt feel a lot more robust and more intuitive to use.
In terms of getting up and running, I would say the biggest pain point was having to set up our own PostgREST server to sit between the app and Amazon RDS, but I understand that PowerSync are working on a simpler solution to this. In general we have been very impressed at their rapid rate of development – whenever we have identified a missing feature, we find they often get around to implementing it so quickly that the solution is often in place before we even get to the point where it was actually a problem for us.
So, if you are trying to implement an app with offline capabilities and want a way to reliably sync your data between devices, I highly recommend trying out PowerSync.