April 6, 2022
5 mins

Understanding what Things are in a Bubble Database

There are some concepts to understand to get to grips with Bubble. Types like Texts and Numbers mean what anyone would think they would mean. Lists of Texts or Numbers are also what you would think they mean. So a list of numbers, is not a number, kind of obvious. And a Text type is not a Number type, kind of obvious.

If Bubble expects a Number type and you supply it with a list of Numbers - it will not work, go red, show up in the issue checker, won’t appear as a suggested option in a list, just not work. If Bubble expects a Number and you supply a Text - that won’t work. Also applies to Dates, these things are builtin into Bubble. Bubble just “knows” about Dates, Numbers, and Texts. (and Users)

Bubble ‘Things’ - bit more abstract. If you had a Spreadsheet that stored ‘Things’ (like fruit), it would have columns of attributes (like name, colour) and rows of data. (like apple, red). I could have another spreadsheet (Thing) that stored Things like Cars (with attributes like make and year of manufacture) and have rows like (Tesla, 2020). So now Bubble might expect a Thing of type Fruit but if you try to supply a Thing type of Cars - it won’t work. Same is Bubble expects a list of Fruit, and you try to supply a Fruit - that won’t work. Because you created in Bubble Things of Cars and Things of Fruit - Bubble “knows” what they are, what attributes they have. These Things and attributes of these things just automatically appear in the Bubble Editor.

But a Database like Bubble is much more powerful than a Spreadsheet, so thinking about Spreadsheets only takes you so far before you get to the questions like “How do I link things up?” “How do set a Car on a User?” How do I find all the Users who have Teslas?

So let’s say I want to store on a User what car they have. I can create a field of type “Car” on the User and in the field I could “link” a row of data in the Car list. Let’s say I link a row that is “Honda, 1984” to a User. So I know that this User has a car, and that car is a 1984 Honda. The name of the Car is “Honda”, but there is a row of data that is “Honda, 1984”. There could be another row which is “Tesla, 2020”. Under the covers Bubble does this linking with a Unique Id for every row in the database - you don’t have to do it - Bubble does the linking for you. You don’t need to say “This user has row number 1 of the Cars” - that is what a Database does. (and this is where Bubble is different to a spreadsheet).

So Bubble understands the difference between the name of the car, (Tesla), and the row in the database that is the Car Thing. Bubble knows about the Things you have created, eg Cars, Fruit. It won’t let you in the Editor try to link or assign, things that don’t make sense because they are different types. I can’t search Users for Cars that are Green Apples. I can’t give a User a car of Banana. I can’t set a Users car as a list of Cars. Bubble makes these things Red or simply not appear in the Editor.

If you are building your understanding of the Bubble database from your understanding of Spreadsheets, there is a leap of understanding to make about how you link things. When I am talking to people about how to design databases there is often this really satisfying moment where they say “Oh so that is how you link things up”.