HSCALE - MySQL Partitioning

Configuration

HSCALE is configured via a Lua script. The path to that script may be set via the environment variable HSCALE_CONFIG_FILE. If not set /etc/hscale.lua will be used.

File Format

As said above the configuration file must be a valid Lua script.

"Basic configuration file"
config = {}

-- Set a value
config.someKey = "value"

return config

Common Options

Option: partitionLookupModule
Description: The name of a Lua module containing the partition logic. Enter the module name not a script file name. The module must be found within the current LUA_PATH.
Example: optivo.hscale.modulusPartitionLookup
Required:

Partition Module Specific Options

Take a look at Partition Lookup Modules.

Example

Full configuration example using ModulusPartitionLookup
config = {}

-- Define the partitioning lookup module to be used.
-- This module tells the application how to split your tables.
-- The Lua file must be found within your LUA_PATH.
config.partitionLookupModule = "optivo.hscale.modulusPartitionLookup"

-- Configure the tables to be partitioned (a, b) with the partition columns ("category", "folder").
config.tableKeyColumns = {
    ["a"] = "category",
    ["b"] = "folder"
}

-- Used for optivo.hscale.modulusPartitionLookup only - the number of partitions per table (i.e. the modulo value)
config.partitionsPerTable = 3

return config