Help Needed: Optimizing Seat Booking Logic Across Multiple Tables

Hello Bubble Community,

I am currently developing a theatre ticket booking system and facing some challenges with the database structure and workflow efficiency. My setup involves 15 rows of seats, with 25 seats per row, each row managed by a separate table in the database. (Row 1, Row 2, Row 3…) Each seat has a Booking State field set as text “Free” or “Booked”. A Display Name example “Row1_Seat25”

Current Setup:

  • On the index page, I display the seat map using 15 different repeating groups in a column alignment, one for each row of seats. And 25 square icons for the individual seats. (First I tried all 375 seats do display from one table in a RG of 15 rows and 25 columns I ran into an error…)

  • Users select seats, which are then stored in a custom state as a list of text items (Example: "Row1_Seat25, ", “Row2_Seat25”, “Row2_Seat24”) on the index page.

  • A popup for checkout displays this list in a RG, and users can finalize their choices by clicking a “Book” button → Stripe Checkout…

Challenge: I need to efficiently update the Booking State of each selected seat across multiple tables when the “Book” button is clicked. The selected seats can be from any of the 15 tables, complicating the workflow. :frowning:

Questions:

  1. How can I efficiently search and update the Booking State for a list of seats that might span across multiple tables based on the user’s selections? But only when a Booking was successful.
  2. Is there a more streamlined approach to handle seat bookings without using separate tables for each row, potentially simplifying the workflow and improving performance?
  3. Any best practices or suggestions on managing large sets of similar data across multiple tables in Bubble?

I appreciate any advice or insights you could share to help optimize this process.

Thank you!

:flushed::flushed: what??

Thats really not a good way to go about things.

Use a single table! If something looks/is structured similarly you almost surely need to use a single table.

Use a single Table called “Seat” and have an integer field for seatRow and an integer field for seatColumn.
If you want to display the seats on the screen to look like a thester, thats a fromtend challenge (just fix the number of rows and columns of your repeating group and make it responsive) , your database should not be store data the same way your frontend displays it.

2 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.