Need help determining how to configure database based on multiple entries

Hello everyone! A feature of the app I am creating is people will be able to store their vehicle information (make, model, year, etc.). They will be able to save as many different vehicles as they want.

I need help determining how I should set up this data. Currently, I have all of the data under the User data type. However, I am unsure how I will store all the different vehicles they enter. Should I continue under data type User? And if so, how should I manage the different data inputs? Or, should I create a new data type for Vehicles and store all of the data inputs there? If I should choose this option - should I choose the ‘multiple entries’ checkbox?

you need to learn about DB structure and arrays/lists.

If you don’t do that, you will regret it down the road when maintaining your app becomes pure unadulterated torture (and then it will be too late to untangle).


I think @code-escapee is right too.
Database relationships are the most important concept in building an application in bubble.
In a relational database, the process of linking and streamlining information together is called “normalization”. If this word doesn’t ring a bell, I suggest you look it up first.

However, we can still offer some hints at this stage regarding your database.

First of all, keep in mind that bubble basically treats the “User table” in a special way.
The bubble database is keyed to the email addresses that are entered there.

If the User table contained all the information, changing just one entry would require a rewrite of the entire database.
For example, let’s assume that one person owns three cars.
If a person changes their registered personal information, such as phone number, it means that the databases for all three cars would need to be rewritten.

So in this case, only the email address and phone number should be entered in the User table. (Of course, it could also contain usernames, etc.)
The information about the car would be stored in the “Vehicles table” as you say, with the email address as the key and tied to the information entered by that user.

Similarly, the database should be created so that information that may change later will not be in the same table. It might be a good idea to draw a diagram to organize what information you might eventually retrieve.

1 Like