The database
This section covers different aspects of how the Bubble database works
The database is the cornerstone of most apps. It handles all the dynamic data, meaning the data that you and your users can create, change, view, and delete as often as needed. That's different from the fixed text and images you place in the editor, which stay the same for everyone. Every signup, every saved post, every user profile in your app lives in the database.

The database works in tandem with your app's design so your users can work with complex data efficiently, without being burdened by the mechanics of how it happens under the hood. Most of your users don't know how it works, and don't even know it's there. They just know that the information they stored in your app yesterday is still there today for them to interact with.
What is a database?
When you hear the term database, you might imagine vast servers, intricate code, and complex structures. But with Bubble, the database is designed to be easy to use and understand.
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, Address, and Date of birth.
Database example
The table below shows what a small database might look like in practice: two data types, User and Blog post, each with their built-in fields and a few custom ones added on top.
User (built-in)
Email (built-in)
Built-in. Email is used for user authentication (signing up and logging in).
Created date (built-in)
Built-in. The date/time when the thing was first created.
Modified date (built-in)
Built-in. The date/time when the thing was last modified.
Unique ID (built-in)
Bubble generates a unique ID for every thing in your database.
Slug (built-in)
Built-in, but not automatically generated. The slug field stores a URL-friendly identifier for a record, like a username in a profile link, and you have to set its value yourself.
First name (custom)
A custom field, usually set to type text.
Last name (custom)
Same as above.
Profile picture (custom)
A custom field of type image.
Blog post (custom)
Created date (built-in)
Built-in. The date/time when the thing was first created.
Modified date (built-in)
Built-in. The date/time when the thing was last modified.
Unique ID (built-in)
Bubble generates a unique ID for every thing in your database.
Slug (built-in)
Built-in, but not automatically generated. The slug field stores a URL-friendly identifier for a record, like a username in a profile link, and you have to set its value yourself.
Post title (custom)
A custom field of type text, holding the title of the blog post.
Post content (custom)
A custom field of type text, holding the content of the blog post.
Author (custom)
A custom field of type user, referencing the user who wrote the blog post.
Within Bubble, this database is visual and intuitive. You'll find it in the Data tab, where, instead of writing SQL queries or scripts to manage your data, you work with a clean, graphical interface. You can create new data types, add fields, or adjust the relationships between different data types with a few clicks. And while Bubble takes care of the heavy lifting in the background, keeping your data secure and retrievable, you can focus on designing the logic and flow of your app.
Every data type also comes with a handful of built-in fields that Bubble fills in automatically: a Creation date, a Modified date, the Created by user, and a unique ID. That unique ID identifies one specific record, so even if two users happen to share a name, your app can always tell their entries apart.
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. Bubble handles these technical aspects, so you can focus on the logic and design of your app.
The database comes with its own set of commands to create, manipulate, and delete data.
Communicating with the database
When you and your users interact with your Bubble app, two computers are involved:
The device 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 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, along with any requested information, is sent back to the device.

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 travel back and forth several times per second.
As the developer, you can set up your app to send all sorts of 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, so it stays private. Say a user provides input about themselves, such as their name and date of birth. When that data is sent to the Bubble server, it's encrypted and can't be read by anyone else. It's also encrypted while stored on the server itself.
Privacy rules
Privacy rules govern which users can access which data. They're the most important part of your database's security, and the main thing standing between your users' private data and the rest of the world.
Without privacy rules, the data your app sends to a user's device can be accessed in full, even the parts your design doesn't display on screen. A privacy rule works at the database level instead, deciding what data ever leaves the server for a given user in the first place. That's what makes it different from simply hiding an element or filtering a search: those control what a user sees, while privacy rules control what a user can actually reach.
Any app that holds personal, sensitive, or otherwise private data relies on privacy rules to keep it protected.
We strongly recommend setting up privacy rules for any app that holds private or sensitive data before it goes live.
Article: Protecting data with privacy rules
Data types and fields
You now know the basic shape of a Bubble database: data types that hold fields, and fields that hold values. The next article puts that into practice, walking through how to create your own data types and fields from scratch.
Article: Data types and fields
Bubble database terminology
Constraint
A filter applied to a search to narrow down the results. For example, retrieving all products with a price less than $50, or blog posts that are marked as published.
Data source
Defines where the data in an expression or element comes from. This is often a specific search (Do a search for) or a 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 data from the database based on certain constraints.
Field
An attribute or property within a data type (e.g., Email, Name, Price). Similar to a column 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.
Thing
An individual record or entry in the database.
Unique ID
A unique identifier automatically assigned to every thing in the database. Bubble uses it to reference and retrieve that specific record.
Additional resources
Other ways to learn
Last updated
Was this helpful?