Reader small image

You're reading from  Democratizing No-Code Application Development with Bubble

Product typeBook
Published inApr 2024
PublisherPackt
ISBN-139781804610947
Edition1st Edition
Right arrow
Author (1)
Caio Calderari
Caio Calderari
author image
Caio Calderari

Caio Calderari is a No-Code Expert, Startup Founder and Senior Product Designer with 17+ years of experience. Starting as a designer in 2005, he worked for advertising, digital agencies, corporate companies and startups worldwide. He learned no-code tools to be able to build his own startups and side projects and later decided to teach others too. In 2020, he created a YouTube channel about no-code tools offering courses and tutorials. By 2021, he became the Chief No-Code Officer at a U.S.-based company, helping entrepreneurs from various countries launch their startup ideas. Caio is a creative individual, passionate about sharing his knowledge. His goal is to bring no-code to more creators, helping them unlock this new world of possibilities.
Read more about Caio Calderari

Right arrow

Database Structuring, Relationships, and Security

In the previous chapter, you learned how to use workflows and build logic inside Bubble. In this chapter, you will learn about databases and how to structure them, create relationships, and add security rules to protect your data.

You will learn how to creatme databases and use workflows to add data to them, allowing you to store users’ information. Learning how to use databases and workflows together is an essential path that will allow you to build dynamic applications inside Bubble.

In this chapter, we will cover the following:

  • Bubble database overview
  • Understanding data types and fields
  • Building a database structure with examples
  • Creating relationships
  • Databases and option sets
  • Connecting data elements within your app
  • Data structure and database management
  • Security best practices

Bubble database overview

Databases allow you to create dynamic applications and Bubble has a built-in database system that allows you to store information right inside your project. Not all no-code tools out there have a built-in database available inside the tool itself; sometimes, you have to connect your no-code tool to an external service that will provide the database for your no-code application, but Bubble has not only workflows and logic but also a built-in database ready for you to use. By the way, if you are wondering, you can also use external databases in Bubble if you wish to – it has both options.

What is a database?

A database is an organized collection of structured information. All the data that is stored in your application goes to a database. It is designed to efficiently manage, store, retrieve, and manipulate data, allowing users or applications to access and work with information quickly and effectively. In simpler terms, a database is like a digital...

Creating database tables and option sets

Let’s see in practice how to create new tables inside your Bubble database. You must plan your database structure before jumping into the tool, otherwise it can become a complete mess. Be careful while structuring your database, as this is a very important part of your application, and building a wrong database at first can become a nightmare in the future. So, just because it is working doesn’t necessarily mean that it has been created correctly. If you are not sure, talk to a professional developer to help you with that or find tools and resources that can help you build a proper database schema.

Creating a database table

Creating a new database table is very simple – just click the New type field and add the name you desire, then click the Create button. You can also choose whether you want this table to be private, meaning only users who created the items will visualize the items they created. This is optional...

Manipulating the database with CRUD

Now that you are familiar with databases, it is time to teach you how to manipulate data and integrate database items with your frontend, your application pages, and interface. This practice is also known as CRUD. These operations are all available inside Workflow Actions and are what will allow you to build cool dynamic applications using no-code. Let’s learn how to create them using Bubble.

Create

After creating the database structure, of course, you want to store data inside it, right? But how do we allow our application users to add data inside the database while using our application? We do this by simply giving them fields to type in information. The creation of data inside your database will rely mostly on your users interacting with your pages, but, of course, that is not the only way to add data to a database; it can also be done using automation, APIs, and backend workflows. Now, we are going to focus on allowing your users...

Privacy rules and security

Defining privacy rules has a direct relation to security in Bubble because these settings help you specify how and who exactly can view and manipulate data on your database. You may think that if a page is not showing data on a field, it might not be exposing it, but a lot of data can be loaded on a page even if it is now visible; this means that people with the right skills and knowledge could easily get access to your app’s data, even if you are not directly displaying it on a page. This is why privacy rules can help, because they will prevent your data from being displayed even before the page loads, protecting it from the foundation of your database. Note that privacy rules play an important part in your app security, but that is not all – some other methods and techniques can be used to make your app more secure, some settings can be configured on the workflows, and even sometimes at the page level. If you are really worried about security...

Security tips

Bubble security is a very important topic and you should pay attention to the best practices to make sure the applications you build are safe, especially when building for clients. Since security is a very deep topic, it is recommended that you continue studying after reading this book. To help you on your journey, here are a few main tips to consider when talking about security:

  • Make sure your Bubble account is safe: Create passwords that are hard to guess but easy to remember, have a minimum length of eight characters, and have one lowercase, uppercase, and special character and one number. Store your password in a safe place; you can use a password manager. Set up your recovery email under your Bubble account Security tab and activate two-factor authentication (2FA settings).
  • Under Privacy & Security, configure the password minimum length feature, set to eight characters, a number, a capital letter, and a non-alphanumeric character. Enable two-factor...

Summary

In this chapter, we did a quick overview of databases and the main topics you need to know to get started, and you learned what a database is, how databases work, and how to create your databases inside Bubble.

You learned about database structures, database schemas, and the difference between a database and option sets, as well as how they work.

You also learned what relationships are and how to create them.

This chapter also explained what CRUD is and how to integrate database items with pages, user workflows, and logic to manipulate data from your database, creating dynamic applications inside Bubble. You also learned about privacy rules, what they are, how they work, and how to set up security rules to ensure you build projects that are not only functional but also secure.

Understanding these concepts will be important for creating dynamic projects that require a database. In the next chapter, you are going to learn how to work with plugins and APIs.

...
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Democratizing No-Code Application Development with Bubble
Published in: Apr 2024Publisher: PacktISBN-13: 9781804610947
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Caio Calderari

Caio Calderari is a No-Code Expert, Startup Founder and Senior Product Designer with 17+ years of experience. Starting as a designer in 2005, he worked for advertising, digital agencies, corporate companies and startups worldwide. He learned no-code tools to be able to build his own startups and side projects and later decided to teach others too. In 2020, he created a YouTube channel about no-code tools offering courses and tutorials. By 2021, he became the Chief No-Code Officer at a U.S.-based company, helping entrepreneurs from various countries launch their startup ideas. Caio is a creative individual, passionate about sharing his knowledge. His goal is to bring no-code to more creators, helping them unlock this new world of possibilities.
Read more about Caio Calderari