Download the PHP package silverstripe-australia/silverstripe-splitdb without Composer
On this page you can find all versions of the php package silverstripe-australia/silverstripe-splitdb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download silverstripe-australia/silverstripe-splitdb
More information about silverstripe-australia/silverstripe-splitdb
Files in silverstripe-australia/silverstripe-splitdb
Package silverstripe-splitdb
Short Description Provides functionality to configure separate read/write database connections
License BSD-3-Clause
Informations about the package silverstripe-splitdb
SilverStripe Split Database module
This module contains an implementation of Read/Write splitting for database queries to allow for master/slave database implementations
Basic Usage
For using aspects, which is effectively database agnostic, read the 'ReadWriteSplitterAspect' section. For using a custom database class against MySQL, read the 'ReadWriteMySQLDatabase' section.
ReadWriteSplitterAspect
Use this aspect to direct READ queries to a particular database, and WRITE queries (ie queries that modify) to a specific master server (that is replicating to those slaves). It is assumed replication is managed externally to SilverStripe.
Add configuration in your project along the lines of
ReadWriteMySQLDatabase
Similar to the previous ReadWrite aspect, the ReadWriteMySQLDatabase relies on setting up a separate write database connection for directing queries to. So the initial database configuration is the same as usual, however instead of using MySQLDatabase, use ReadWriteMySQLDatabase (or ReadWriteSQLiteDatabase). This configuration must point to the readonly database.
Then, via YAML config, create configuration for the write specific database (note that the configured Injector object MUST be called SplitterWriteDatabase)
Maintainer Contacts
- Marcus Nyeholt [email protected]
Requirements
- SilverStripe 3.1.?
License
This module is licensed under the BSD license at http://silverstripe.org/BSD-license