The database
This section covers different aspects of how the Bubble database works
Last updated
This section covers different aspects of how the Bubble database works
Last updated
The database is the cornerstone of most applications. It handles all the dynamic data, meaning data that you and your users can create, change, view and delete as frequently as needed.
The database works in tandem with your app's design to give your users the combination of being able to work with complex data efficiently, without being burdened by the mechanics of how it actually happens under the hood. Most of your users don't know how it works and indeed don't even know that it's there – they just know that the information they stored in your app yesterday is still there today for them to interact with.
When you hear the term database, you might imagine vast servers, intricate codes, and complex structures. But with Bubble, the idea of a database is made refreshingly simple and user-friendly.
At its core, a database is a structured collection of data. Think of it as a digital library, where instead of books, you have data entries, and instead of shelves, you have tables or, in Bubble’s terminology, data types. Each data type can have several fields that store specific kinds of information. For instance, a data type User might have fields such as Name, Email, and Date of birth.
Within Bubble, this database is visual and intuitive. Rather than writing SQL queries or scripts to manage the data, you interact with a clean, graphical interface. You can create new data types, add fields, or adjust relations between different data types with a few clicks. And while Bubble takes care of the heavy lifting in the background, ensuring that the data remains secure and retrievable, you can focus on designing the logic and flow of your application.
For those familiar with traditional databases, Bubble's approach simplifies many of the complexities involved. There's no need to stress about database schemas, SQL syntax, or indexing. Instead, Bubble handles these technical aspects, allowing creators to focus on the logic and design of their app, making the process of integrating and utilizing a database far less daunting.
The database comes with its own set of commands to create, manipulate and delete data.
When you and your users interact with your Bubble app, two computers are involved:
The device that the user is accessing the app from (such as a laptop or cell phone)
Bubble's server (located in a server park)
Whenever an action is needed that involves the database, such as reading, writing or deleting data, that command is sent from the user's device to the server, where the job is completed and a confirmation and any requested information is sent back to the device.
As such, working with data in your app is an ongoing stream of communication between the user's device and the Bubble server. This doesn't just happen on page load, but continually as the user provides your app with actions and input. Even for a single user, small packets of data can be sent back and forth several times per second.
As the developer of the app, you can set it up to send all sorts of different commands to the server:
Create things
Make changes to and delete things
Search for things and return the result as a list
Find one specific Thing and return its content
Any data sent between the user's device and the server is encrypted at all times, ensuring that it stays private. Let's say a user provides input about himself such as name and date of birth: when that data is being sent to the Bubble server, it's encrypted and can't be read by anyone else. It's also encrypted during storage on the server itself.
Privacy rules are rules that govern what users can access what data. It's the most important part of your database's security, and we strongly recommend that all apps that host any kind of private or sensitive data set up privacy rules to protect it.
Article: Protecting data with privacy rules
In the next article in the series, we'll look into how you create custom data types, and populate them with fields to store relevant information.
Article: Data types and fields
Term | Description |
---|---|
Constraint | A filter applied to a search to narrow down the results. For example, retrieving all products with a price less than $50. |
Data source | Defines where the data in an expression or element comes from. This is often a specific search (Do a search for) or direct reference to a type of data in the database (such as Parent group's thing). |
Data type | Represents a category of data (e.g., User, Product, Order). Similar to a table in traditional databases. |
Do a search for | The data source that retrieves specific data from the database based on certain constraints. |
Field | Attributes or properties within a Data Type (e.g., Email, Name, Price). Similar to columns in a table. |
List | A collection of things. For instance, a user might have a list of favorite products. A field can be set up to store one thing or a list of things. |
Privacy rule | Criteria that determine how data can be searched for, modified, or viewed based on user roles or other conditions. |
Repeating Group | A UI element in Bubble that displays a list of things from the database, allowing for dynamic rendering of data. |
Thing | An individual record or entry in the database. |