My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Post hidden from Hashnode

Posts can be hidden from Hashnode network for various reasons. Contact the moderators for more details.

App developers don't have to make bad Database choices

App developers don't have to make bad Database choices

Jignesh Solanki's photo
Jignesh Solanki
·Jan 16, 2018

Let's be honest. Most of the developers don't have a clue about how and why to select a particular database. I often see them ignoring the importance of a right database in their tech stack to build a mobile application.

At the moment, we have a wide number of databases available to support one functionality of the application.

Consider these use-cases for example:

  • MongoDB to store JSON documents
  • PostgreSQL to store objects as documents
  • SQLite to store locally which needs no additional configuration
  • Redis for high-scale data caching
  • Cassandra to handle unstructured data at any scale

With so many database options available, it is easy to make mistakes for any developer or organisation.

Crisp, a SaaS based startup, had to abandon Firebase because they couldn't scale. Their application was supposed to handle hundred of thousands of messages between two clients in real time, and it seems like Firebase failed to offer that.

Consequently, I have come across many other startups who have faced such issues and have wasted resources on migrating from one database to another.

Even, Uber has to migrate from PostgreSQL to MySQL.

All these migration stories made me think about how one should evaluate their application needs, and select a right mobile app database.

I did my research, asked my peers and DB experts about their approach before writing this guide.

Altogether, I took many application use-cases and criteria to evaluate against. Like:

  • When you have multiple data layers in your application
  • When your app needs offline synchronisation between multiple devices
  • Encryption keys conflict when synchronisation is enabled
  • Database for high network interruptions
  • When you want to scale your app from 0 to 1 million users
  • When you frequently push updates and don't want the database to break
  • When you're using multiple databases in the same app
  • When your app needs MVCC(Multi-Version Concurrency Control) support
  • When you're building a real time streaming application

I even took different types of transaction requirements into consideration before making a final call on the right database for each category.

The comprehensive guide for database selection is available here: Database Selection Guide for Mobile App Developers

I would love to your thoughts and experiences on how did you made a decision.