Skip to content

Offload database management to secondary database, thinking about hyperdb, ludicrousdb. #1360

@saas786

Description

@saas786

Feature Request

As I see you are already using \WP_Stream\DB_Driver_WPDB, which can be be made pluggable.

ref: https://github.com/xwp/stream/blob/3.9.1/classes/class-db-driver-wpdb.php#L13

So for starters, something like this:

before:

public function __construct() {
...
		global $wpdb;
		$prefix = apply_filters( 'wp_stream_db_tables_prefix', $wpdb->base_prefix );
...
}

after:

public function __construct() {
...
		global $wpdb;
		
		$custom_$wpdb = apply_filters( 'wp_stream_db_tables', $wpdb );
		$prefix = apply_filters( 'wp_stream_db_tables_prefix', $custom_$wpdb->base_prefix );
...
}

ref: https://github.com/xwp/stream/blob/3.9.1/classes/class-db-driver-wpdb.php#L41

So where ever $wpdb is referenced, we could replace it if needed.

Reason

We have about 15 million entries for Stream, which is not ideal, slows down our website significantly, so would like it to be offloaded, so it can store / retrieve data from secondary database.

Loom_MSiJQj5Ptk

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions