table-sharding Yii extension that partitions horizontally large tables for easy searching and faster query

Table Sharding

  1. Requirements
  2. Usage
  3. Contributing
  4. Further Features
  5. Sources

A Yii extension that horizontally partitions large tables for easy searching and faster query.

Requirements

  1. Yii 1.1.14 (Not yet tested on other version)
  2. MySQL Table

Table Schema:

CREATE TABLE IF NOT EXISTS 'shardtable' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'columnName' varchar(255) NOT NULL,
  'count' int(11) NOT NULL,
  'dateSharded' timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY ('id')
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

Usage

  • Create an extensions folder under protected if none exists.
  • Add the php file in your import array
import=>array(
    ...
    'application.extensions.Sharding',
),
  • Edit tableName method on your Models
public function tableName()
{
  /**
   * $tablename refers to the table you want to shard
   * $limit refers to the max row of your table
   */
  $var = new Sharding('$tablename',$limit);
  return $shard->useTable();
}

Contributing

You can contribute to this project by:

  1. Browse for issues, proposals, and report for bugs.
  2. Fork my repo, make some changes and issue a pull request.

Whatever contribution is welcomed (may it be constructive criticism, feedbacks, violent reactions, or if you feel that my code is just plain stupid).

Further Features

Features that I will be working on in the near future.

  1. Asynchronous sharding
  2. Scheduled sharding

WARNING! USE AT YOUR OWN RISK

Sources

My GitHub Repository

0 0
1 follower
0 downloads
Yii Version: Unknown
License: LGPL-3.0
Category: Database
Developed by: Matthew Torres
Created on: Feb 25, 2014
Last updated: 10 years ago

Related Extensions