active_record_shards icon indicating copy to clipboard operation
active_record_shards copied to clipboard

Dynamic shards (aka for each account)

Open bogdan opened this issue 7 years ago • 0 comments

Current gem configuration allows to specify a limit number of shards which (as "Usage" section suggest) should be used as buckets for each account (or account-like entity).

In my case I want each account to have a separated database. That will allow to save the disk space in the sharded tables by not including the account_id column in indexes and table itself. In other words, I want to use the Account#id as a shard_id. There is no benefit in storing several accounts under the same shard.

Currently this is not possible due to static configurations of the shards that allows to define a limited and static set of shards.

Is there a way to define dynamic shards? Are you interested in the PR?

bogdan avatar Jan 26 '18 15:01 bogdan