Most mobile apps suck — here’s how to fix them
Working offline
Even 10 years after the rise of smartphones, we can’t assume devices will always be online. Developers must think offline-first when building an app.
The best ones take full advantage of connectivity when available, but understand it’s temporary.
For offline, apps need a way to store data on the device. That way they can still function when the service drops.
Unfortunately, most apps today use datastores not designed for mobile. Many use relational frameworks that aren’t intuitive for developers and slow down deployment.
Developers have to write lines upon lines of custom code. Rows and columns of data need custom mapping code to allow them to run with objects that the developers are working in.
This all impacts the app’s performance — screens take longer to load and the features become unusable.
Real-time data sync (or lack of)
These legacy datastores also lack a native, real-time sync solution. It means they’re unable to sync data between a device and a backend server when a user is online. Users end up seeing inaccurate data in their app, or the app might crash altogether.
Sync also powers features that users nowexpectin mobile apps. Think real-time messaging, collaboration, and the ability to see where your taxi is at that moment. Without these features, people won’t use it.
They’re not always easy to include, because:
Mobile apps must reflect accurate data, even though data will be changing across many users, devices, and the backend.
As users take action on an offline device, data changes stay on the mobile device. Once the device is online, data needs syncing between the device and the backend.
Data conflicts inevitably emerge, and if they aren’t handled well, users will find data that’s out of date, inaccurate, or lost.
Syncing takes significant time to develop due to the amount and complexity of custom code needed. Developers building a sync solution themselves have a set of less-than-ideal choices:
-
They can choose not to sync data, and instead download all the data onto a device:This is caching, and it has its problems. The data can’t update easily. It takes up space on a user’s mobile phone and drains battery life.
-
Build a sync solution, but aim to keep it simple:Simple sync solutions rarely deliver a good user experience. Conflict resolution is inherently complex. It requires custom networking and conflict-resolution code. Trying to simplify it with simple logic will result in users seeing data that’s out of date.
-
Build a sync solution, working with REST:On the surface, working with REST can appear simple. But the lack of a guaranteed connection makes it complicated. When the connection drops while syncing data, logic needs to be in place to handle the errors and retry sending the data. Writing this code is complex. It can take weeks or months of work, and thousands of lines of code. The simplicity of REST turns out to be much more complicated in reality.
Building it “the right way” is tough. With devices dropping signal from block to block, apps need custom code to retry requests and handle errors when trying to sync data. If at any point this code isn’t working perfectly, the application might crash.
A mediocre app leads to low adoption & bad reviews
Legacy datastores and DIY data sync have consequences that we’re all too familiar with:
-
Negative impact on app development and developer productivity: Developers spend time writing extra, complex code. It slows down the development of key features that users want.
-
Poor app performance: Apps with legacy datastores and poor sync run slow and crash.
-
Low adoption and retention: A mediocre app won’t get used. Users will uninstall it, losing time and money.
The fix
Developers today have a tough choice. Build an app quickly and compromise on performance, or build it well and pay the price (of timeandmoney).
What they need is a simplified approach that works for them. One that is flexible, intuitive, and mobile-first.
MongoDB Realmis just that. It lets developers build fast and build well. It’s powered by the Realm Mobile cross-platform datastore and native sync solution. It will help you iterate faster and deliver reliable apps. It’s used by many household names including 7Eleven, CBT Nuggets, and Acxiom.
So get ready to build a five-star app, unlike that transport one. Join over 100k+ developers using the Realm Mobile Database, and get started for free withMongoDB Realm.
Story byAlexander Stigsen
CTO, MongoDB RealmCTO, MongoDB Realm
Get the TNW newsletter
Get the most important tech news in your inbox each week.