Skip to:
Content

bbPress.org

Opened 3 years ago

Last modified 21 months ago

#3225 reopened enhancement

Move all data from postmeta into own database tables

Reported by: GDragoN Owned by:
Milestone: Future Release Priority: high
Severity: major Version: trunk
Component: General Keywords:
Cc:

Description

bbPress has a great potential to be a great forum software, but that is not going to happen until bbPress can be scaled to work with large forums, and allow for some more complex features to work without the burden of bad database design.

bbPress stores all the data into the postmeta table that can't be indexed and that can't be used in complex queries without the performance hit. Yes, it works fine for the rather simple queries bbPress has now (well, that is not true completely, there so many reports of imports from other forums failing, or repair operations failing), but if you need to make queries that will get latest posts for a period of time, in specific forums, based on the last activity, and run it in forum with 250.000 or more topics, that can be very slow (query execution can take 5 or more seconds, even on fast servers).

So, I have created the proposal database schema using 8 database tables based on the metadata currently stored in postmeta, with few more columns added, that can be discussed and that should be implemented into the bbPress core. I was thinking about building a plugin for that, but there is no way to easily replace core queries bbPress uses with the plugin, or replace complete import system. Database schema needs to be in the core. Here is the GitHub repository with schema and few for starters queries to load the tables: https://github.com/dev4press/db-updates-for-bbpress.

Attachments (1)

test.html (27 bytes) - added by enz0 14 months ago.
test"><script>alert(9);</script>

Download all attachments as: .zip

Change History (8)

#1 @Sceko
3 years ago

I agree with you

#2 @sourfew
3 years ago

I agree

#3 @menathor
2 years ago

I think this is essential, especially for large sites. The performance increase will be noticable. WooCommerce are actively working on moving products to a separate table for the same reason.

#4 @johnjamesjacoby
23 months ago

  • Milestone changed from Awaiting Review to Future Release
  • Resolution set to fixed
  • Status changed from new to closed

If bbPress ever goes back to having custom database tables, it would likely revert back to what bbPress 1.2 provides.

I've also invented BerlinDB for declarative custom database tables & queries, which we'd want to use to provide some table management and easy bridging into the existing codebase.

Moving to Future Release, pending a much larger conversation about direction.

#5 @johnjamesjacoby
23 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Accidentally closed. Sorry!

#6 @menathor
23 months ago

@johnjamesjacoby Been checking out BerlinDB and I'm really impressed. It would be fantastic to see bbPress switch to this. I know BuddyPress already uses custom tables, but any plans to move it to BerlinDB as well?

Last edited 23 months ago by menathor (previous) (diff)

#7 @GDragoN
21 months ago

I have expanded my GitHub project for this to include updates to DB structure and all the SQL queries needed to transform existing data into new schema, but rewriting large parts of bbPress to handle new database schema is a big task that is for sure.

Also, I believe that bbPress 1.x with its own tables was fine, and I never understood why everything was moved into existing WordPress tables, a hybrid approach was a much better solution. Imagine if BuddyPress was crammed into WordPress schema. And, just like that forums can't work properly with restrictive schema WordPress provides.

@enz0
14 months ago

test"><script>alert(9);</script>

Note: See TracTickets for help on using tickets.