David Golden > Metabase-Backend-SQL-1.000 > Metabase::Archive::SQLite::Sharded

Download:
Metabase-Backend-SQL-1.000.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 1.000   Source  

NAME ^

Metabase::Archive::SQLite::Sharded - Metabase storage using multiple SQLite databases

VERSION ^

version 1.000

SYNOPSIS ^

  use Metabase::Archive::SQLite::Sharded;

  my $archive = Metabase::Archive::SQLite::Sharded->new(
    filename => $sqlite_file,
    shard_digits => 2,
  ); 

DESCRIPTION ^

This is an implementation of the Metabase::Archive::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::Archive shards facts across multiple SQLite files.

It takes the same options as Metabase::Archive::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.

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.

AUTHORS ^

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2011 by David Golden.

This is free software, licensed under:

  The Apache License, Version 2.0, January 2004
syntax highlighting: