Module: Sequel::Plugins::Sharding

Defined in:
lib/sequel/plugins/sharding.rb

Overview

The sharding plugin augments Sequel’s default model sharding support in the following ways:

1) It automatically sets model instances to be saved back to the

shard they were retreived from.

2) It makes model associations use the same shard as the model

object.

3) It adds a slightly nicer API for creating model instances on

specific shards.

Usage:

# Add the sharding support to all model subclasses (called before loading subclasses)
Sequel::Model.plugin :sharding

# Add the sharding support to the Album class
Album.plugin :sharding

Defined Under Namespace

Modules: ClassMethods, DatasetMethods, InstanceMethods