Metabase::Index::SQLite::Sharded - Metabase index using multiple SQLite databases
version 1.001
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. The 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.
shard_digits
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.
filename
David Golden <dagolden@cpan.org>
Leon Brocard <acme@astray.org>
This software is Copyright (c) 2011 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
To install Metabase::Backend::SQL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Metabase::Backend::SQL
CPAN shell
perl -MCPAN -e shell install Metabase::Backend::SQL
For more information on module installation, please visit the detailed CPAN module installation guide.