Database Management in App Development

Gumi & Company
4 min readSep 20, 2023

A database is a crucial component of any application as it stores all of the data that the application needs to function, and it is essential for ensuring that the application is reliable, efficient, secure, and scalable.

It is the component that is manipulated by the CRUD (create, read, write, delete) activities we carry out on our various apps.

When you post a tweet on Twitter (oh, sorry X), a “Tweet” record is created on the database. You are able to see and read the tweet you just tweeted. Oh no! Your post is missing an important word and the relevant hashtags. You can write the post by editing it (if you have a blue tick) and can also decide to delete that post because you feel that it’s totally unnecessary and it’s none of your business. Congrats! You just carried out the four basic database manipulation activities. Every action you perform on your various apps revolves around this concept.

Good database design is essential for creating a database that meets the needs of the application. It involves carefully planning the structure of the database, the relationships between the data, and the way that the data will be accessed.

In designing a database, there are many factors to consider, but some of the most important are:

  • The type of data that will be stored in the database

The type of data here refers to the file format which is mostly text. However, there are other data types. They include images, videos, user, timestamps, files, boolean, integer, geographic address, and a few others. The app cannot accept or process data types different from the type that was initially set. To put it another way, you can’t upload a video to an input that says “Please enter your email here”.

  • The relationships between the data

There’s a concept called entity relationship database in database design. Let me explain: If I am building a simple to-do list app, that stores the event and user data. The user data type is likely to contain the user name and profile picture fields while the event data type could contain fields like event name, description, time, and status. To determine the creator of a to-do event, a user field has to be included in the events fields thereby creating a relationship between both data types

  • The expected volume and frequency of data access

It is important to consider the potential size of the database record. A perfect instance is determining whether to create a data type separately or to keep a list field within a data type. A good practice to ensure database efficiency is not to have a list field that could potentially store more than a hundred records as it takes the app more time and processing power to fetch them, giving the end user a negative notion that the app is slow and not performant.

  • The performance requirements of the application

Apps perform differently depending on the use case. Let’s compare WhatsApp and Google Drive for instance. Some user experiences one would expect from a messenger app are speed and prompt notifications while Google Drive is built to handle large data upload, management, and synchronization. As of the time of writing this blog, you don’t expect Google Drive to complete an upload size of a hundred gigabytes in a few seconds even if the database is designed in the most efficient way. The wait time is just part of the process but having to wait for a minute for a message to be sent after clicking the send button on WhatsApp could be a result of a bad database design. If an app must function in a particular way, then the database should also be designed accordingly, to suit that purpose.

  • The security requirements of the application

Security requirements are deeply woven into an application’s database design. Neglecting proper design principles can leave an application vulnerable to breaches, compromises, and data leaks. On the contrary, a meticulously planned database architecture acts as a bulwark, providing layers of protection against the ever-present threats in the digital realm. Here’s a practical illustration. It is better to store the credit card details of the users of a FinTech app on a separate data type and attach a user to it rather than storing the details on a field in the user type. Setting it up this way will ensure that even if the user data is compromised, the credit card details aren’t still accessible because it was stored on a. separate data type usually with extra layers of privacy rules set on them.

By carefully considering these factors, you can design a database that is efficient, reliable, secure, and scalable.

--

--