Metabase::Index::SQLite::Sharded - Metabase index using multiple SQLite databases
use Metabase::Index::SQLite::Sharded; my $index = Metabase::Index::SQLite::Sharded->new( filename => $sqlite_file, shard_digits => 2, );
This is an implementation of the Metabase::Index::SQL role using SQLite shards.
SQLite stores a database entirely in a single file. That starts to become slow as the size of the file gets large. This Metabase::Index shards the index across multiple SQLite files.
It takes the same options as Metabase::Index::SQLite, with one additional option,
shard_digits attribute defines how many digits of the GUID to use as a shard key. Each digit is a hexadecimal number, so digits increase the number of shards as a power of 16. E.g., "1" means 16 shards, "2" means 256 shards and so on.
The shard key is inserted to the database
filename parameter either before the final period or at the end. E.g. for
shard_digits of "2" and
filename "db.sqlite3", the shards would be "db_00.slite3", "db_01.sqlite3", and so on.
David Golden <firstname.lastname@example.org>
Leon Brocard <email@example.com>
This software is Copyright (c) 2011 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004