Non-FictionStartup GuideNo-Code Build
Bubble Custom States Guide eBook
Use Bubble custom states for temporary data. Manag
by Carlin Sena
Use Bubble custom states for temporary data. Manage UI state without database writes.
Formats
Free sample
Chapter 1: The Million-Dollar Mistake--–- It was 3 AM when Sarah watched her Bubble app crash for the eleventh time that week. Her marketplace startup had 47 active users, a waitlist of 1,200 people, and a database bill that had just tripled. The culprit? Every time a user clicked "filter," "sort," or "next page," her app was writing to the database. Temporary UI state—filter selections, which tab was open, what was in the shopping cart—was being treated like permanent, historical data.
She was paying for every click, every hover, every accidental refresh. Three months of work, and the architecture was failing not because her idea was bad, but because she had never learned one fundamental distinction: the difference between data that belongs in a database and data that belongs in the browser.This chapter is about that distinction. It is the single most important concept in this entire book, and getting it wrong has cost no-code founders millions of dollars in unnecessary workload units, lost users due to sluggish interfaces, and countless hours of debugging "mysterious" behavior. By the time you finish this chapter, you will understand why most Bubble beginners overpay by 40-60%, why your app feels slow even when your database is empty, and—most importantly—how to fix it all by changing nothing more than where and when you store temporary information.The Default Instinct That's Draining Your Wallet Every new Bubble developer shares a common first instinct. It feels logical, even virtuous.
You build a form. The user types into an input field. Your workflow says: "Create a new thing" or "Make changes to a thing." The data goes to the database. You feel productive. The app works.
You move on.This instinct is wrong. Not always, but most of the time. And the cost is invisible until it isn't.Let me show you what I mean. Imagine you are building a product search page for an e-commerce site. A user arrives, sees 200 products, and wants to filter by category, price range, and color.
They check three checkboxes. Using the default instinct, you might write to the database at each checkbox click—storing their filter preferences as a "User Preference" record. Or more commonly, you might run a new search for each filter change, hitting the database repeatedly.Now imagine 1,000 users doing this simultaneously. Each user clicks through five filters before finding what they want. That's 5,000 database operations.
Each operation consumes Workload Units (WUs). Each WU costs money. And none of those operations needed to happen because filter selections are temporary. They exist only for that user, on that device, during that session. The moment the user closes the tab, those filter choices should vanish like smoke.Sarah's marketplace crash at 3 AM happened because she was storing each user's "current view" settings—which product list page they were on, which sorting order they selected, which filters were active—as separate database records.
When 47 users each generated 200-300 temporary state changes per session, her database was processing over 10,000 writes per hour. For temporary data. Data that, if lost, would cause no harm beyond a minor inconvenience.The solution is not a bigger database plan or faster hosting. The solution is understanding what "temporary data" means and learning to keep it exactly where it belongs: in the browser, not on the server.Defining Temporary Data: What It Is and What It Isn't Before we go any further, we need a crystal-clear definition. Temporary data is any information that does not need to outlive the user's current interaction with your application.
It exists to facilitate the user experience in the moment, and if it disappears—due to a page refresh, a closed tab, or a cleared browser cache—the user should not lose anything they would reasonably expect to persist.Let me give you concrete examples from both sides of the line.Examples of Temporary Data (Keep in Browser)Filter and sort selections: A user chooses "price low to high" on a product listing. If they refresh the page, they might be mildly annoyed, but no real data is lost. The products are still in the database. They can simply reapply the sort.UI state (which tab is open, which modal is visible): A user clicks a "details" accordion on a dashboard. The fact that the accordion is open is not something they expect to survive a page refresh.
It's purely a convenience for the current viewing session.Multi-step form progress (with caveats): A user fills out step one of a three-step registration form. The data they entered is temporary until they click "Submit." If they close the browser, they expect to start over. (There are exceptions—draft-saving features—which we will cover in later chapters and the appendix.)Shopping cart contents (controversial but correct): Many beginners are shocked to hear that shopping cart items are, strictly speaking, temporary data. Amazon does not save your cart to their database every time you click "Add to Cart." They save it in your browser or as a session cookie. Why?
Because a cart that hasn't been purchased is worthless historical data. Only upon checkout does the cart become an order—permanent data worthy of database storage.Checkbox and toggle states: A user checks a "Remember my preferences" box on a settings screen. The state of that checkbox before they click "Save" is temporary. Only when they submit does it become a permanent preference.Examples of Permanent Data (Belongs in Database)User accounts and profiles: The fact that Sarah created an account on March 15th is permanent.Transactions and orders: A completed purchase generates a permanent record for accounting, fulfillment, and customer service.Content created by users: A blog post, a comment, a listing—these must survive browser crashes, power outages, and device changes.User preferences after saving: Once a user explicitly saves a setting (e.g., "email notifications on"), that preference should persist across sessions and devices.Analytics events: If you need to know that a user clicked a button for your business intelligence, that click belongs in a database or analytics service.The line between temporary and permanent is not always obvious, and throughout this book we will explore edge cases. But the core principle is simple: If losing the data would cause the user to lose work they intended to save, it is permanent.
Otherwise, it is temporary.The Performance Tax: Why Databases Are Slow Even When Empty Here is a truth that database companies do not advertise: retrieving or writing data is always slower than reading from the user's own browser memory. Always. Even on a fiber connection. Even with a high-performance database. Even with caching.
The physical reality is that a database request must travel from the user's browser to a server, possibly across thousands of miles, be processed, and travel back. A custom state lives in the browser's RAM. It is measured in milliseconds. The database is measured in tens or hundreds of milliseconds. The difference is invisible for one operation but crushing for fifty.Let me quantify this for you.A typical Bubble database read (a "search for" operation) takes between 50 and 200 milliseconds, depending on server load, data complexity, and geographic distance.
A custom state read is essentially instantaneous—typically under 1 millisecond. If your interface performs 20 database searches during a single…
This is the end of the free sample. Get the eBook to keep going. Buy now
About this book
Details
- Author
- Carlin Sena
- Publisher
- SamEnrico
- Language
- English
- Genre
- Non-Fiction, Startup Guide, No-Code Build
- Released
- 2026-06-01
- Pages (approx.)
- 136
- Available as
- eBook, Audiobook
Read better in the ZLOADR app
Your eBooks on your phone or tablet. Sign in with your SamEnrico account and start reading.
More by Carlin Sena
Okta Auth Failure Emergency PlanCarlin Sena$11.99
Affirmation Purpose Statement CourseCarlin Sena$11.99
Zumba for Beginners CourseCarlin Sena$11.99
The Workplace Nap GuideCarlin Sena$11.99
Setting Realistic Grade ExpectationsCarlin Sena$11.99
The Poisoner of Beirut: A Forensic Puzzle in the Shadow of ProhibitionCarlin Sena$11.99
How to Become a Gate GuardCarlin Sena$11.99
Startup Employee Promotion CaseCarlin Sena$12.99
Lead Fullstack EngineerCarlin Sena$11.99
Understanding Varadi–papp SyndromeCarlin Sena$17.99You may also like
Hong Kong Handover 1997Dunn Johnnie$11.99
Zumba For Postnatal Recovery CourseNeal Christian$11.99
Zumba for BeginnersLadner Nikia$11.99
YouTube Comment Mining GuideHumes Pandora$12.99
Worry Box MeditationCarlin Rudy$11.99
Workplace Stress MeditationNguyen Lynn$11.99
Workplace Stress and Sleep RepairHawley Ivory$11.99
Workplace Perfectionism CureDelaney Jeffry$11.99
Workplace Injustice Anger GuideWallen Isabelle$11.99
Work Addiction and Burnout LinkGreenwood Ester$11.99
Women in Yoga and WellnessBeattie Galina$11.99
Women in Stand Up ComedyChun Evangeline$11.99