Iterating on Your Bubble App’s Data Structure
If you’re like most people I speak with, you’re amazed at how relatively easy and quick you can create your app’s User Experience in Bubble. You find adding text fields, inputs, dropdowns, buttons, pictures, change color, etc to be fairly straightforward. Then you start adding Data Fields and Workflows so you can “write” data into the database. Your app is becoming more “interactive”!
Then you take the next step and begin creating your own Data Type with their own Data Fields. Now things start to get a little more complicated. You start to have multiple Data Types that are related to each other and also the special “User” Data Type provided by Bubble. The Workflows to modify data get a little more complicated. The Search criteria starts to get a bit more complicated. You wonder how to create a Repeating Group which will show not only the information about a User but also about two other Data Types. How do you Search for that? Uh oh. Do a Search within a Cell? But that’s a performance hit and slows your app down. Things have now gotten real complicated. You’re scratching your head trying to figure out how to get out of this mess. Maybe you’re getting a little bit tense and frustrated too. After all, isn’t this codeless development? Something that non-techies can do? Why has this become so hard?
If you’ve ever experienced something like this, congratulations! You have now experienced and learned how the three high-level areas of your app, User Experience, Data Structure and Algorithm (Logic), are interdependent and interact with one another. This is totally normal and if you didn’t experience it, you’re either “not there yet” or you’re a gifted developer (“unicorn”).
Now you want to take a step back and take a holistic look at your app design, particularly the data structure. Have you heard the expression “put yourself in their shoes”? Now think of your data from your data’s perspective and how it flows thru your app. Maybe you need to make one of your Data Types a Data Field in your User Data Type. Then when you search for a User, you now get access to the Data Fields in that other Data Type. And maybe that second Data Type has a Data Field which is of a third Data Type. Let’s walk thru an example.
Let’s say you have an app for College Students at a University and there are different Colleges at the University, ie College of Arts, College of Business, College of Engineering, etc. Each of those Colleges have different Degrees, ie in College of Engineering it may be Bachelor of Science in Civil Engineering, in Chemical Engineering, in Electrical Engineering, in Computer Engineering, in Mechanical Engineering, etc. And each of those has a list of courses to take. Below is a high-level image of what the Data Structure for this type of application would look like.
With this data structure, you can go into each of the Data Types you created (ie College, Degrees, Classes) and manipulate them as needed. And for each User, you can “drill down” to a specific user’s classes. So for a Repeating Group with a Search for Users, in each of the Repeating Group cells you could have a text showing that User’s classes. See image below.
If you’ve read this far, chances are you’re experiencing your own data structure challenges. Fortunately you can make changes to your app’s data structure. But first, re-read the example above and think thru how your data flows through your app. Every app is different but chances are there’s a “hierarchy” in your data flow, similar to the example above. Figure out the hierarchy in your app. Then update the data structure to make the data flow more easily. It’s not alway easy to do but restructuring your data is part of the app development experience.
Once your app is being used by your customers and you get user feedback, chances are good you’ll need to make changes to your app which will include some updates to the data structure. Hopefully any data structure changes are done when your user base is small. Otherwise you run into the risk of manually updating the data in data fields in your “Live” version of your app. This is not a fun place to be, especially if you have a lot of users needing data field updates (which you’ll need to do manually).
On a final note, here’s one thing to be aware of. When you delete a Data Field and that Data Field is used in your Workflow, your Workflow will be broken. If you create a new Data Field with the exact same name and Field Type, your Workflow(s) will still be broken. You’ll need to go back into the Workflow and re-add whatever Data Field was deleted. Bubble does this to keep app integrity.
As you can see, data structures are an important part of your app’s overall architecture. Giving this part of your app design can be challenging because it’s a little bit abstract. Creating user personas can help you think thru what data is needed for your users. Just remember that creating your app will be an iterative process because you’re constantly learning more. It’s a normal part of the development process.