Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Gauravk Posted September 6, 2018 Posted September 6, 2018 I have some new requirement where we need to add a section in our community with tons of data and we wish to keep that data on a separate DB than the core DB. If it's possible, appreciate if someone can explain how?
bfarber Posted September 6, 2018 Posted September 6, 2018 There's no provision within the software to store any data in an external database, except for the forum archiving feature. You can do this with customizations by passing different details to the database handler library easily.
Gauravk Posted September 6, 2018 Author Posted September 6, 2018 52 minutes ago, bfarber said: You can do this with customizations by passing different details to the database handler library easily. Can you please elaborate on this, how to do that as a novice user or do I need a programmer to edit this request? Secondly, if this multi DB system will slow down anything although DB will be on the same physical server.
bfarber Posted September 7, 2018 Posted September 7, 2018 Using a secondary database connection in and of itself won't slow anything down - that largely depends upon your server configuration and specifications. You will need a programmer to do this. $database = \IPS\Db::i( 'mycustomdatabase', array( 'sql_host' => ..., 'sql_user' => ..., 'sql_pass' => ..., 'sql_database' => ..., 'sql_port' => ..., 'sql_socket' => ..., 'sql_tbl_prefix'=> ..., 'sql_utf8mb4' => isset( \IPS\Settings::i()->sql_utf8mb4 ) ? \IPS\Settings::i()->sql_utf8mb4 : FALSE ) ); foreach( $database->select( '*', 'mytable' ) as $row ) { print_r($row); }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.