Databases are at the heart of most mobile apps, so choosing the right one will be critical to your application’s success. At its most basic, databases collect and store user information during a one-time registration process and after that, it negates the need to repeatedly log into the app.
When smartphones first made an appearance, an internet connection was needed for mobile apps to work, but that’s not the case anymore. Today, if your app relies on a connection, chances are pretty high that you’ll be experiencing an app that’s unpredictable and extremely sluggish (and unsuccessful!).
To limit the need to rely too much on the network, cloud services and database providers now offer synchronization and offline capabilities to enhance mobile offerings. For example, we now have industry-leading solutions like the following:
- Amazon Cognito
- Couchbase Mobile
- Google Firebase
- Microsoft Azure Mobile Services
All these solutions come built with synching capabilities to meet the demands of the market by ensuring that apps work efficiently both online and offline.
Check out our sister company's case: How Intersog Built a Native Android App Using Backend As s Service (BaaS) Solution.
There are also several different types of databases to choose from:
- Data warehouses (enable organizations to collect, store, and analyze the data in large data warehouses over a number of years)
- Distributed databases (for businesses with multiple geographical locations which have their own set of databases that come together to form the main database)
- End-user databases (for businesses with workstations that act like a small database in itself)
- Operational databases (where different operational databases can be changed and manipulated to meet business needs)
- Relational databases (a common database solution where data is stored in the form of data tables with a unique key field that’s used to connect to other related tables).
It’s important to choose the right one as it will be a long-term decision that can be expensive and complicated to change later on.
But with so many options in the marketplace, how do you select the right database for your mobile application offering?
Here are eight key factors to consider when evaluating your database solutions.
1. What’s the structure of the data?
The data’s structure will dictate how it’s stored and retrieved. As most apps deal with data in a variety of formats, the process of selecting the database should include the appropriate data structures for storing and retrieving the data.
If you fail to do this, your mobile application will be slow to retrieve the data from the database. Furthermore, it will also require more development time to work around the data issues that will certainly come up.
Other data related elements that can play an important role are as follows:
- Accessibility to the data
- Size of the data you wish to store
- Scope of multiple databases
- Speed and scalability
2. Will you require a flexible data modeling solution?
The flexibility of data modeling will dictate if you can appropriately and effectively articulate your data model requirements for your mobile app. But what’s critical here is whether it will allow you to evolve your model efficiently as requirements change over time.
As mobile apps today evolve rapidly, model flexibly quickly becomes an important factor to consider. In this scenario, relational databases can be a good choice if you require strong data consistency. The same is true if the data will be highly relational.
However, if the requirements are relaxed, NoSQL databases are the way forward as they offer enhanced flexibility.
3. What client platforms does it support?
Are you planning on supporting iOS, Android, or both? Or are you looking to go beyond and support the Windows Phone as well? What about IoT devices and wearables?
Even if you plan to support more platforms at a later date, you have to take that into consideration now. A lot of mobile applications today evolve to add a web companion app or a native desktop app, so that’s something you have to think about.
If you plan on going down the same path, it will be important to evaluate cloud options and databases based on the required platform support during the lifecycle of the application.
4. How much data security will you need?
Whether at rest or in motion, a high level of security must be maintained consistently. If the storage is decentralized and synchronized, it’s also important to enable secure access and transmission.
As a result, you will need to look at the following:
- Authentication
- Data in motion
- Data at rest
- Read/write access
As far as authentication goes, it has to be flexible enough to allow the following authentication providers:
- Custom
- Public
- Standard
At the same time, anonymous access is also important, so for the data to both rest on the server and the client, you will need to be able to support both file system encryption and data-level encryption.
For the data that’s in motion, all communication should be conducted on secure channels like TLS or SSL. Furthermore, for data read/write access, the database will need to provide granular control over what information can be accessed and modified by users.
5. How will it resolve data conflicts?
Mobile platforms or platforms that generally use decentralized data writes can quickly experience conflicts as the same data can be simultaneously modified by multiple devices. As a result, you will need a robust support mechanism to resolve conflicts.
What’s important here is the flexibility of the conflict resolution mechanism. The one you choose should be able to seamlessly enable conflict resolution on the device, by a human, by an external system, in the cloud, automatically.
This process will differ from system to system. Ideally, it’s better to go with systems like Couchbase Mobile which utilizes revision trees with a default resolution rule of “most active branch wins.”
It’s the same method used by Git and is quite different from clock-based systems. For mobile apps, the latter is highly unsuitable as there will be issues around clock differences across devices.
6. Do you need the ability to control how the system synchs?
For most mobile applications, the ability to control how the system synchs is very important. This includes conditional replication, replication filtering, and replication strategy.
When it comes to conditional replication, you might need to replicate the data under certain conditions. For example, when the device has sufficient battery power or when it’s connected to WiFi.
Replication filtering, on the other hand, will require the ability to only replicate some of the data and not other data. Replication strategy will require support for push, polling, one-time, and streaming. Furthermore, you should also be allowed to utilize a combination of strategies.
7. What are your partition requirements?
To meet your partition requirements, you will need configurable synch topology support (like star). This will enable certain parts to function offline.
Star topology is quite common because it enables devices to connect to a central hub utilizing a point-to-point connection (which also allows devices to function offline). There are other common topologies like tree and mesh which allow different parts of the system and devices to operate offline.
8. Do you want to build or buy your synch capabilities?
When it comes to adding synch to your mobile app, you will need to make a decision on whether you want to build your own synch solution or buy it from an established provider. For most apps, you’re better off buying as building your own synch will be extremely difficult and expensive (because you have to deal with complexities associated with distributed computing).
What’s important here is to find a solution that’s highly flexible. However, if you’re determined to build your own synch, then you will need to be prepared to expand a significant amount of time and money to achieve it.
When evaluating mobile synch and storage providers, be sure to go over everything listed above as it will be critical to developing a flexible, secure, manageable, and dependable mobile application.
What else would you add to this list? Does your experience offer a different perspective? Please share your thoughts in the comments section below.
Featured image courtesy of Digi117.com