Bubble Docs
  • Introduction
  • New? Start Here
  • What is Bubble?
  • The Glossary
  • User manual
    • Getting started
      • What is Bubble?
      • Building for...
        • Web
        • Native iOS and Android
          • Mobile app quick start guide
          • What is a native mobile app?
          • Native mobile vs. web development
          • Differences in native and web elements
          • Native mobile app terminology
      • Building your first app
        • Planning features
        • Database structure
        • Design and UX
        • eCommerce and payments
          • Shopping cart
          • Checkout page
          • One-time payments
          • Subscriptions
          • Marketplace
      • Creating and managing apps
      • The Bubble editor
        • Tabs and sections
          • Design tab
            • The element tree
            • The property editor
          • Workflow tab
          • Data tab
          • Styles tab
          • Plugins tab
          • Settings tab
            • Application settings
              • Custom headers/body
              • Visual settings
              • Social media sharing
              • Translating your app
              • Email settings
              • Collaboration
            • Custom domain and DNS
          • Logs tab
        • Tools
          • Key features
          • The search tool
          • The Issue Checker
          • The element tree
          • The element property editor
          • The debugger
          • Notes
        • Previewing your app
      • Transitioning to Bubble from...
        • JavaScript
        • HTML and CSS
        • SQL
    • Design
      • Elements
        • Web app
          • The page
          • Containers
            • Groups
            • Repeating groups
            • Table elements
            • Popups
            • Floating groups
            • Group focus
          • Visual elements
          • Input forms
            • Text and numbers
            • Dates and time
            • File uploads
            • Selection controls
        • iOS and Android app
          • The view
          • Containers
          • Visual elements
          • Input forms
          • Mobile reusable elements
        • The element hierarchy
          • The element tree
        • Reusable Elements
      • Styling
        • Color variables
        • Font variables
        • Styles
        • Custom Fonts
      • Responsive design
        • Building responsive pages
        • Legacy articles
          • The Basics (Legacy)
          • Building Responsive Pages (Legacy)
          • Migrating Legacy Pages
          • Tips When Designing (Legacy)
      • Templates
      • The Component Library
      • Importing from Figma
    • Data
      • The database
        • Data types and fields
        • Creating, saving and deleting data
        • Finding data
        • Displaying data
        • Protecting data with privacy rules
        • The database editor
        • Export/import data
          • Exporting data
          • Importing data (CSV)
        • Working with location data
        • Using Algolia
        • Database structure by app type
          • Marketplace Apps
          • Directory & Listings Apps
          • Social Network Apps
          • SaaS Apps
          • Project Management Apps
          • CRM Apps
          • Professional Services Apps
          • On-demand Apps
          • Documentation/ CMS Apps
          • Applicant Tracking System (ATS) Apps
          • Portfolio Apps
          • Gallery Apps
          • Online Store / Ecommerce Apps
          • Blog Apps
          • Messaging App
          • Dashboards
          • Building Block Apps
          • Bubble as a backend
      • Files
      • Images
      • Static data
        • App texts (translations)
        • Option sets
      • Temporary data
        • Custom states
        • URL parameters
      • User accounts
        • Authentication plugins
          • Facebook plugin
          • Fitbit plugin
          • Google plugin
          • Instagram plugin
          • LinkedIn plugin
          • Pinterest plugin
          • Slack plugin
          • Wistia plugin
          • YouTube plugin
        • Cookies set by Bubble
      • Time, dates and time zones
    • Logic
      • The frontend and backend
      • Workflows
        • Events
          • Frontend events
            • Recurring workflows
            • Custom events
          • Backend events
            • Database trigger events
        • Actions
        • API Workflows
      • Dynamic expressions
      • Conditions
      • Navigation
        • Single-page applications (SPA)
        • Multi-page applications
        • Page slugs
      • Device resources
        • Location services
        • Camera/photo library
    • Workload
      • Understanding workload
        • Activity types
        • The workload calculation
        • Client-side and server-side processing
      • Tracking workload
        • Measuring
          • Using App Metrics
        • Monitoring
          • Workload notifications
          • Infinite recursion protection
      • Optimizing workload
        • Optimization framework
        • Optimization checklist
          • Page load
          • Searches
          • Workflows and actions
          • Backend workflows
        • Agency showcases
          • Minimum Studio
          • Neam
          • Support Dept
    • Security
      • Bubble's security features
      • Planning app security
      • Client-side and server-side
      • Bubble account security
      • App security
      • Page security
      • Database security
      • API security
        • API Connector security
        • Data API security
        • Workflow API security
      • Flusk
        • Overview
        • Flusk plan features
        • Getting started with Flusk
        • Flusk security tools
          • The Issues Explorer
          • Issue details
          • Tools and settings
            • Pages rating
            • Database rating
        • Flusk FAQ
      • Cookies
      • Security checklist
    • Previewing your app
      • Previewing a web app
      • Previewing a mobile app
    • Publishing your app
      • Web app
      • Native mobile app
        • Global native mobile settings
        • iOS App Store
        • Google Play Store
        • Publishing FAQ
    • AI
      • Generate apps with AI
        • About AI app generation
      • AI page designer
      • Connect to AI agents
    • Maintenance
      • Collaborators
      • Version control
        • Best practices: Version control
        • Transitioning from the legacy version control
        • Terminology: Version control
        • Version Control (legacy)
      • Commenting
      • Database maintenance
        • Copying the database
        • Restoring database backups
        • Bulk operations
          • Bulk operation methods compared
        • Wiping change history
      • Performance
        • Hard limits
        • Capacity Usage (legacy)
        • Notes on queries
      • SEO
        • Introduction to SEO
        • SEO: App
        • SEO: Page
      • Testing and debugging
        • Introduction to testing and debugging
        • The debugger
        • The server logs
        • Supported browsers
      • API workflow scheduler
    • Integrations
      • API
        • Introduction to APIs
          • What is a RESTful API?
        • The Bubble API
          • Bubble API terminology
          • Authentication
            • How to authenticate
            • No authentication
            • As a User
            • As an admin
          • The Data API
            • Data API Privacy Rules
            • Data API endpoints
            • Data API requests
          • The Workflow API
            • Workflow API privacy rules
            • Workflow API endpoints
            • API workflows
              • Creating API workflows
              • Scheduling API workflows
              • Recursive API workflows
              • API Workflow Scheduler
              • Case: Stripe notifications
        • The API Connector
          • Authentication
          • API Connector security
          • API guides
            • OpenAI
              • Authentication
              • Calls
                • ChatGPT
                  • Chat
            • Google Translate
              • How to setup Google API keys
          • Streaming API
        • API security
        • Plugins that connect to APIs
        • API Glossary
      • Plugins
        • What Plugins Can Do
        • Installing and using Plugins
        • Authentication plugins
        • Special Plugins
      • SQL Database Connector
      • Bubble App Connector
      • WorkOS
        • WorkOS SSO
        • WorkOS API
    • Infrastructure
      • Sub-apps
      • Bubble release tiers
      • Hosting and scaling
        • How Bubble hosting works
        • Scaling with Bubble
        • CDN (Cloudflare)
        • Bubble app names
        • Domain and DNS
      • Compliance
        • GDPR
        • SOC 2 Type II
        • HIPAA
        • Other frameworks and standards
    • Bubble for Enterprise
      • Hosting and infrastructure
        • Dedicated instance
          • The Dedicated editor experience
          • Technical specs
          • Main cluster dependencies
          • Customizable options
          • Migration process
            • Pre-migration
            • During migration
            • Post-migration
      • Security and compliance
        • Single sign-on (SSO)
        • GDPR
        • SOC 2 Type II
        • HIPAA
        • Other frameworks
        • Bubble's security features
      • Admin and collaboration
      • Priority support
      • Billing and Payment Guideline for Dedicated Instances
  • Core Reference
    • Using the core reference
    • Bubble's Interface
      • Design tab
      • Design tab (Legacy)
      • Workflow tab
      • Data tab
      • Styles tab
      • Styles tab (Legacy)
      • Plugins tab
      • Settings tab
      • Logs tab
      • Template tab
      • Toolbar
      • Top and context menu options
      • Deployment and version control
        • Deployment & Version Control Dropdown (legacy)
      • Notes
    • Elements
      • Native mobile elements
        • View element
        • List component
      • General properties
      • General properties (Legacy)
      • Styling properties
      • Styling Properties (Legacy)
      • Responsive Properties
      • Responsive Properties (Legacy)
      • Conditional formatting
      • States
      • Page Element
        • Page Element (Legacy)
      • Visual Elements
      • Containers
      • Container Layout Types
      • Containers (Legacy)
      • Input Forms
      • Reusable Elements
      • Element Templates (legacy)
    • Workflows
    • Events
      • General events
      • Element events
      • Custom events
      • Recurring event
      • Database trigger event
    • Actions
      • Account
      • Navigation
      • Data (things)
      • Email
      • Element
      • Custom
    • On-device resources
    • Data
      • Data Sources
      • Operators and comparisons
      • Search
      • Privacy
    • Styles
    • API
      • The Bubble API
        • The Data API
          • Authentication
          • Data API endpoints
          • Data API requests
        • The Workflow API
      • The API Connector
        • Authentication
        • Adding calls
    • Bubble-made Plugins
      • AddtoAny Share Buttons
      • Airtable
      • API Connector
      • Blockspring
      • Box
      • Braintree
      • Bubble App Connector
      • Chart.js
      • Circle Music Player
      • Draggable Elements
      • Dropzone
      • Facebook
      • Fitbit
      • Full Calendar
      • Google
      • Google Analytics
      • Google Optimize
      • Google Places
      • Ionic Elements
      • iTunes
      • Slidebar Menu
      • LinkedIn
      • Localize Translation
      • Mixpanel
      • Mouse & Keyboard Interactions
      • Multiselect Dropdown
      • Progress Bar
      • Rich Text Editor
      • Rich Text Editor (Legacy)
      • Screenshotlayer
      • SelectPDF
      • Slack
      • Segment
      • Slick Slideshow
      • SQL Database Connector
      • Star Rating
      • Stripe
      • Tinder-like Element
      • Twitter
      • YouTube
      • Zapier
    • Application Settings
      • App plan
      • General
      • Domain / email
      • Languages
      • SEO / metatags
      • API
      • Collaboration
      • Sub-apps
      • Versions
  • Account & Marketplace
    • Account and billing
      • Pricing and plans
        • Plans and billing
        • Billing cycle
        • FAQ: Pricing and Workload
      • Account Management
      • Building Apps for Others
      • Selling on the Marketplace
      • Plans & Billing (legacy)
    • Official Bubble Certification
      • Hiring certified developers
    • Building Plugins
      • The Plugin Editor
      • General Settings
      • Updating to Plugin API v4
      • Adding API Connections
      • Building Elements
      • Building Actions
      • Loading Data
      • Publishing and versioning
      • Github Integration
    • Building Templates
    • Application and data ownership
    • Marketplace policies
    • Bug reports
  • Vulnerability Disclosure Policy
  • Beta features
    • About the Beta features section
    • Native mobile apps
Powered by GitBook
On this page
  • Data types recommended - Basic example
  • blogPost
  • Data types recommended - Scalable example
  • blogPost
  • blogContent
  • blogLikes
  • Option sets recommended
  • blogContentType
  • Example uses in your app
  • About the author: Jason K

Was this helpful?

  1. User manual
  2. Data
  3. The database
  4. Database structure by app type

Blog Apps

Last updated 3 years ago

Was this helpful?

By Jason K (Founder of)

Various members of the Bubble ecosystem contributed these use case-oriented database guides. There's always more than one way to do something in Bubble, but the advice here can help you get started if you're new to Bubble!

Many websites use a blog to promote their product, keep their users engaged and display updates about their business. If you are new to Bubble, and web developing in general, you might be struggling to put together the database for it. In this article, we will discuss a few different options to match your skill level and scale requirements. Building a blog with complexity might be more difficult than you might think. Let’s check out some options to help you on your no-code journey!

We will go over two options for your data structures for two different levels of how complex your blog will be - we will call them Basic and Scalable. You can choose which data structure you will want to follow according to your needs. There is always more than one way to do something. Here are just a few ideas.

Data types recommended - Basic example

This example is for a basic blog that doesn’t go into much detail. This is not recommended at scale for large blogs but will be fine for a small blog if you are just starting out. Simple design and easy to set up. Great for beginners if you are trying to just set up your first blog.

As a site owner you will add your blog information into this main data type allowing for it to be displayed on a blog page.

blogPost

This will be your main data type. This will hold the majority of your data and will normally be displayed in a repeating group on your page. Notice how we don’t pluralize the name here since each one (each “thing”) will be a singular blog post.

Suggested fields on this type

  • title (text): This will be the title of your blog post.

  • summary (text): This will be the summary of your article that will be displayed underneath the title

  • byLine (text): The name of the person who wrote the article

  • content (text): The content of your blog post; here we can use the Rich Text Editor plugin to add images and formatting, but even the resulting rich text can be stored as a “text” by Bubble

  • visible (yes/no): This will allow you to turn posts on or off from being visible on your blog

Privacy rules for this data type

We will assume that you want the Blog to be public, so we will keep the data type and all its fields public. When creating the data type, make sure not to check the box to make it private. Similarly, after creating it, there will be no need to create privacy rules for it.

Data types recommended - Scalable example

This example is for an intermediate blog where posts can have more detail and flexibility. As an example, this allows for each blog post to have a different structure to it instead of one standard structure. This should allow for better scaling. This is great for more experienced users if you are trying to just set up a more professional blog.

blogPost

This will be your main data type. This will hold the majority of your data and will normally be displayed in a repeating group on your home page. Notice how we don’t pluralize the name here since each one will be a singular blog post.

Suggested fields on this type

  • title (text): This will be the title of your blog post.

  • summary (text): This will be the summary of your article that will be displayed underneath the title

  • byLine (text): The name of the person who wrote the article

  • blogContentList (list of blogContents): This is a list of your blogContent data type (see below)

  • visible (yes/no): This will allow you to turn posts on and off from being visible on your page

Privacy rules for this data type

We will assume that you want the Blog to be fully public so we will keep the data type public, similarly to the Basic example.

blogContent

This is your content for the blog post. It will hold the body and images of each post’s content. This allows for the flexibility of different structures in the blog content: this data type enables you to store each section of the post’s content as an individual blogContent, which then lets you display the different sections with different formatting. For example, perhaps you want one paragraph (which would be its own blogContent) to be formatted left-aligned, whereas you want the following paragraph (which would be another blogContent) to be formatted right-aligned for emphasis.

If you wanted to make your blog even more flexible, you could build on top of this data type to store additional fields like “order” to set the order in which different chunks of content appear on the page, or “expiration” to set a time before/after which that particular chunk of content should appear.

Suggested fields on this type

  • parentBlogPost (blogPost): this is how each blogContent knows which blogPost it belongs to

  • blogContentType (blogContentType): this is the option set that will help you distinguish which type of content this will be, an image, text of a certain styling, or something else (see below). Having this field allows you to customize how this chunk of blogContent shows up on the page - the page can display this thing differently depending on its blogContentType.

  • text (text): this is where your body paragraphs will go. Each will be in its own blogContent

  • image (image): this is where an image in your post can be stored

Privacy rules for this data type

We will assume that you want the Blog to be fully public so we will keep the data type public, similarly to the Basic example.

blogLikes

Suggested fields on this type

  • parentBlogPost (blogPost): this stores which blogPost actually got the ‘like’

  • creator (User): this is who liked the post (built in already)

Privacy rules for this data type

This could have privacy rules on it to not share exactly which user(s) liked a post publicly. In this case, we may want to rely on privacy rules on the User data type - we always recommend having privacy rules on User, given it likely stores sensitive information like email addresses. At minimum, one such privacy rule could be when ‘This user is current user’, they can see their own data but their own data should not be public to anyone else. You only need to be publicly allowed to search this data type to get the count.

Option sets recommended

blogContentType

  • text

  • imageSmall

  • imageLarge

  • textAlignLeft

  • textAlignRight

  • textAlignCentered

This option set, used in our Scalable example, gives you the ability to describe what a particular section of blogContent is. In this example, this flexibility then allows you to align different section of a blogPost differently, or display an image in a large vs small format. You could add other options in this set if you want even more different ways for a chunk of content to appear.

Example uses in your app

About the author: Jason K

These are just two options for building a blog on Bubble. Setting up an app’s database structure can be very tricky for new developers, so we hope this helps.

This data type allows you to break out the blog post and blog post content separately. The site owner will create a blog post and then add the blog content as a within that blog post. This allows for different blog structures as your users view the different blog posts.

This data type is if you want to have users ‘like’ a post. We could save the list of ‘like’ing users as a list on each blogPost, but this list might be very large eventually and would slow down your app at scale. Hence, we’re creating it as a different data type. ( is a lot more background on this choice.)

Do a Search for BlogPosts - This would help you display your main blogPosts on your home page when this query a repeating group. For a result in this list - each of which would be one cell of a repeating group - the user would likely be able to click on a link to be taken to that particular blogPost with all of its blogContent.

Do a Search for BlogContent where parentBlogPost = Current Page’s blogPost - On a , this query will pull up all the blogContents for that blogPost, which can then be displayed in a repeating group on the page. Since we are also saving the blogContent as a list on the blogPost, you can access it by saying Current page blogPost’s blogContentList as well.

Need more help? Check us out at for one-on-one coaching and the eLearning Hub where you can find more video tutorials, lots of free content, and a blog like the example above. 😊

www.NoCodeMinute.com
repeating group
Here
powers
page that’s showing a particular blogPost
www.NoCodeMinute.com