embedded_databases/0000755000175000001440000000000010653745705014555 5ustar benusers00000000000000embedded_databases/t/0000755000175000001440000000000010653745661015021 5ustar benusers00000000000000embedded_databases/t/30-dbm-bdbwithenv.t0000644000175000001440000000104510653466143020315 0ustar benusers00000000000000#!/usr/bin/env perl use strict; use warnings; use Test::More qw[no_plan]; use constant TEST_PACKAGE => 'DBM::BDBWithEnv'; BEGIN { use_ok( TEST_PACKAGE ); } require_ok( TEST_PACKAGE ); do { my $dbm = eval{ TEST_PACKAGE->new }; warn '$@ = ', $@ if $@; ok( ! $@, 'eval new', ); ok( ref $dbm eq TEST_PACKAGE, 'ref dbm eq ' . TEST_PACKAGE, ); }; do { my $dbm = eval{ TEST_PACKAGE->new }; $dbm->trunc; $dbm->set( 'foo' => 'bar' ); my( $foo ) = $dbm->get( 'foo' ); ok( $foo eq 'bar', 'set foo' ); }; __END__ embedded_databases/t/50-dbm-mysql.t0000644000175000001440000000105710653467271017336 0ustar benusers00000000000000#!/usr/bin/env perl use strict; use warnings; use Test::More qw[no_plan]; use constant TEST_PACKAGE => 'DBM::MySQL'; BEGIN { use_ok( TEST_PACKAGE ); } require_ok( TEST_PACKAGE ); do { my $dbm = eval{ TEST_PACKAGE->new }; warn '$@ = ', $@ if $@; ok( ! $@, 'eval new', ); ok( ref $dbm eq TEST_PACKAGE, 'ref dbm eq ' . TEST_PACKAGE, ); }; do { my $dbm = eval{ TEST_PACKAGE->new( debug => 1, ) }; $dbm->trunc; $dbm->set( 'foo' => 'bar' ); my( $foo ) = $dbm->get( 'foo' ); ok( $foo eq 'bar', 'set foo' ); }; __END__ embedded_databases/t/200-app-test.t0000644000175000001440000000005710653476706017245 0ustar benusers00000000000000#!/usr/bin/env perl use strict; use warnings; embedded_databases/t/100-dbm-benchmark.pl0000644000175000001440000000016510653456521020342 0ustar benusers00000000000000#!/usr/bin/env perl use strict; use warnings; use Benchmark(); use DBM::MySQL; use constant CACHE_SIZE => 1_000; embedded_databases/t/20-dbm-bdbwithoutenv.t0000644000175000001440000000107310653465374021052 0ustar benusers00000000000000#!/usr/bin/env perl use strict; use warnings; use Test::More qw[no_plan]; use constant TEST_PACKAGE => 'DBM::BDBWithoutEnv'; BEGIN { use_ok( TEST_PACKAGE ); } require_ok( TEST_PACKAGE ); do { my $dbm = eval{ TEST_PACKAGE->new }; warn '$@ = ', $@ if $@; ok( ! $@, 'eval new', ); ok( ref $dbm eq TEST_PACKAGE, 'ref dbm eq ' . TEST_PACKAGE, ); }; do { my $dbm = eval{ TEST_PACKAGE->new( writer => 1, ) }; $dbm->trunc; $dbm->set( 'foo' => 'bar' ); my( $foo ) = $dbm->get( 'foo' ); ok( $foo eq 'bar', 'set foo' ); }; __END__ embedded_databases/t/300-bench.t0000644000175000001440000000374110653666076016574 0ustar benusers00000000000000#!/usr/bin/env perl use strict; use warnings; use Benchmark(); use constant CACHE_SIZE => 1_000; use constant PACKAGES => qw( DBM::GDBM DBM::BDBWithoutEnv DBM::BDBWithEnv DBM::SQLite DBM::MySQL DBM::CFM ); # use constant PACKAGES => qw( DBM::CFM ); # use constant PACKAGES => qw( DBM::GDBM ); BEGIN { for my $package ( PACKAGES ) { eval "use $package;"; } } for my $package ( PACKAGES ) { my $dbm = $package->new( debug => 1 ); $dbm->trunc; } for my $package ( PACKAGES ) { my $dbm = $package->new( debug => 1, ); populate_dbm( $dbm, CACHE_SIZE, ); } for my $package ( PACKAGES ) { my $dbm = $package->new( debug => 1, ); for my $count ( 1 .. CACHE_SIZE ) { my( $get ) = $dbm->get( $count ); warn '$count ', $count, ' not set' if not $get; } my( @keys ) = $dbm->list; } sub once { my( $class ) = @_; my $dbm = $class->new(); my $count = 1; return sub { $count = ( $count >= CACHE_SIZE ) ? 1 : $count + 1; warn 'no ', $count if not $dbm->get( $count ); }; } sub every { my( $class ) = @_; my $count = 1; return sub { my $dbm = $class->new; $count = ( $count >= CACHE_SIZE ) ? 1 : $count + 1; warn 'no ', $count if not $dbm->get( $count ); }; } Benchmark::cmpthese # Benchmark::timethese ( -2, { map { ( my $c = $_ ) =~ s/DBM:://; ( $c . '_O' => once( $_ ), $c . '_E' => every( $_ ), ) } PACKAGES, } ); sub populate_dbm { my ( $dbm, $cache_size ) = @_; my $populate_start = Time::HiRes::time; for my $count ( 1 .. $cache_size, ) { $dbm->set( ( $count ) => ( $count x 1500 ) ); } warn sprintf( '[%0.9fs] populate_dbm( "%s" )', Time::HiRes::time - $populate_start, $dbm, ); } __END__ # warn sprintf( '( stat "%s" )[ 7 ] = %s', '/tmp/cfm', ( stat '/tmp/gdbm' )[ 7 ], ); # warn '@keys = ', join( "\n", @keys ); # my( $get ) = $dbm->get( $count ); # warn '$count ', $count, ' not set' if not $get; embedded_databases/t/40-dbm-sqlite.t0000644000175000001440000000104110653466126017460 0ustar benusers00000000000000#!/usr/bin/env perl use strict; use warnings; use Test::More qw[no_plan]; use constant TEST_PACKAGE => 'DBM::SQLite'; BEGIN { use_ok( TEST_PACKAGE ); } require_ok( TEST_PACKAGE ); do { my $dbm = eval{ TEST_PACKAGE->new }; warn '$@ = ', $@ if $@; ok( ! $@, 'eval new', ); ok( ref $dbm eq TEST_PACKAGE, 'ref dbm eq ' . TEST_PACKAGE, ); }; do { my $dbm = eval{ TEST_PACKAGE->new }; $dbm->trunc; $dbm->set( 'foo' => 'bar' ); my( $foo ) = $dbm->get( 'foo' ); ok( $foo eq 'bar', 'set foo' ); }; __END__ embedded_databases/t/60-dbm-cfm.t0000644000175000001440000000104010653467560016730 0ustar benusers00000000000000#!/usr/bin/env perl use strict; use warnings; use Test::More qw[no_plan]; use constant TEST_PACKAGE => 'DBM::CFM'; BEGIN { use_ok( TEST_PACKAGE ); } require_ok( TEST_PACKAGE ); do { my $dbm = eval{ TEST_PACKAGE->new }; warn '$@ = ', $@ if $@; ok( ! $@, 'eval new', ); ok( ref $dbm eq TEST_PACKAGE, 'ref dbm eq ' . TEST_PACKAGE, ); }; do { my $dbm = eval{ TEST_PACKAGE->new }; $dbm->trunc; $dbm->set( 'foo' => 'bar' ); my( $foo ) = $dbm->get( 'foo' ); ok( $foo eq 'bar', 'set foo' ); }; __END__ embedded_databases/t/10-dbm-gdbm.t0000644000175000001440000000105710653464624017075 0ustar benusers00000000000000#!/usr/bin/env perl use strict; use warnings; use Test::More qw[no_plan]; use constant TEST_PACKAGE => 'DBM::GDBM'; BEGIN { use_ok( TEST_PACKAGE ); } require_ok( TEST_PACKAGE ); do { my $dbm = eval{ TEST_PACKAGE->new }; warn '$@ = ', $@ if $@; ok( ! $@, 'eval new', ); ok( ref $dbm eq TEST_PACKAGE, 'ref dbm eq ' . TEST_PACKAGE, ); }; do { my $dbm = eval{ TEST_PACKAGE->new( writer => 1, ) }; $dbm->trunc; $dbm->set( 'foo' => 'bar' ); my( $foo ) = $dbm->get( 'foo' ); ok( $foo eq 'bar', 'set foo' ); }; __END__ embedded_databases/t/01-dbm-dal.t0000644000175000001440000000052710652676175016732 0ustar benusers00000000000000#!/usr/bin/env perl use strict; use warnings; use Test::More qw[no_plan]; use constant TEST_PACKAGE => 'DBM::DAL'; BEGIN { use_ok( TEST_PACKAGE ); } require_ok( TEST_PACKAGE ); do { my $dbm = eval{ TEST_PACKAGE->new }; # warn '$@ = ', $@ if $@; ok( $@, 'eval new (should fail)', ); ok( ! $dbm, '! dbm', ); }; __END__ embedded_databases/lib/0000755000175000001440000000000010652670705015317 5ustar benusers00000000000000embedded_databases/lib/DBM/0000755000175000001440000000000010653745661015726 5ustar benusers00000000000000embedded_databases/lib/DBM/BDBWithEnv.pm0000644000175000001440000000172110652753063020153 0ustar benusers00000000000000package DBM::BDBWithEnv; use Data::Dumper; use BerkeleyDB; use Moose; extends 'DBM::BDBWithoutEnv'; # with 'DBM::DALRole'; has 'env_flags' => ( is => 'ro', isa => 'Num', default => DB_CREATE | DB_INIT_MPOOL, ); has 'cache_file' => ( is => 'ro', isa => 'Str', default => sub { $_[0]->cache_dir . '/bdbwithenv' }, ); sub init_dbm { my $self = shift; my $env = BerkeleyDB::Env->new( -Home => $self->cache_dir, -Flags => $self->env_flags, -Mode => oct( '0644' ), ) || die sprintf( 'Could not create BerkeleyDB::Env in "%s" - "%s" - "%s"', $self->cache_dir, $BerkeleyDB::Error, $!, ); my $bdb = BerkeleyDB::Btree->new( -Filename => $self->cache_file, -Flags => $self->db_flags, -Mode => oct( '0644' ), -Env => $env, ) || die sprintf( 'Could not create BerkeleyDB::Btree in "%s" - "%s" - "%s"', $self->cache_file, $BerkeleyDB::Error, $!, ); return $bdb; } no Moose; 1; __END__ embedded_databases/lib/DBM/SQLite.pm0000644000175000001440000000447110653667070017430 0ustar benusers00000000000000package DBM::SQLite; use Data::Dumper; use DBI; use Moose; extends 'DBM::DAL'; with 'DBM::DALRole'; has 'cache_dir' => ( is => 'ro', isa => 'Str', default => '/tmp', lazy => 1, ); has 'cache_file' => ( is => 'ro', isa => 'Str', default => sub { $_[0]->cache_dir . '/sqlite' }, ); has 'set_sth' => ( is => 'rw', isa => 'Object', ); has 'get_sth' => ( is => 'rw', isa => 'Object', ); has 'list_sth' => ( is => 'rw', isa => 'Object', ); has 'remove_sth' => ( is => 'rw', isa => 'Object', ); sub init_dbm { my( $self ) = @_; my $dbm = DBI->connect( sprintf( 'dbi:SQLite:%s', $self->cache_file, ) ) || die "Could not connect $! - $DBI::Errstr"; $dbm->do( 'CREATE TABLE IF NOT EXISTS sqlite ( key VARCHAR( 255 ) NOT NULL, value TEXT, PRIMARY KEY ( key ), UNIQUE ( key ) )' ); $dbm->do( 'CREATE INDEX IF NOT EXISTS key_index ON sqlite ( key )' ); my $set_sth = $dbm->prepare( 'INSERT INTO sqlite ( key, value ) VALUES ( ?, ? )' ) || confess; my $get_sth = $dbm->prepare( 'SELECT value FROM sqlite WHERE key = ?' ) || confess; my $list_sth = $dbm->prepare( 'SELECT key FROM sqlite' ) || confess; my $remove_sth = $dbm->prepare( 'DELETE FROM sqlite WHERE key = ?' ) || confess; $self->set_sth( $set_sth ); $self->get_sth( $get_sth ); $self->list_sth( $list_sth ); $self->remove_sth( $remove_sth ); return $dbm; } sub trunc { my( $self ) = @_; warn sprintf( 'unlink( "%s" ) = "%s"', $self->cache_file, scalar unlink( $self->cache_file ) ) if $self->debug; return $self->new( %{ $self } ); } sub get { my( $self, $key ) = @_; my $get_sth = $self->get_sth; $get_sth->execute( $key ); my( $rv ) = $get_sth->fetchrow_array; return $rv; } sub set { my( $self, $key, $val ) = @_; my $rv = $self->set_sth->execute( $key, $val ); return $rv; } sub list { my( $self ) = @_; my( $list_sth ) = $self->list_sth; $list_sth->execute; return map { $_->[ 0 ] } @{ $list_sth->fetchall_arrayref }; } sub remove { my( $self, $key ) = @_; my( $rv ) = $self->remove_sth->execute( $key ) ; return $rv; } sub DEMOLISH { my( $self ) = @_; my $dbm = $self->dbm; for my $sth( qw[set_sth get_sth list_sth remove_sth] ) { $self->$sth()->finish; } undef $dbm; } no Moose; 1; __END__ embedded_databases/lib/DBM/BDBWithoutEnv.pm0000644000175000001440000000326410653665365020717 0ustar benusers00000000000000package DBM::BDBWithoutEnv; use BerkeleyDB; use Moose; extends 'DBM::DAL'; with 'DBM::DALRole'; has 'db_sync' => ( is => 'rw', isa => 'Bool', default => 0, ); has 'db_flags' => ( is => 'ro', isa => 'Num', default => DB_CREATE, ); has 'cache_dir' => ( is => 'ro', isa => 'Str', default => '/tmp', lazy => 1, ); has 'cache_file' => ( is => 'ro', isa => 'Str', default => sub { $_[0]->cache_dir . '/bdbwithoutenv' }, ); sub init_dbm { my $self = shift; my $bdb = BerkeleyDB::Btree->new( -Filename => $self->cache_file, -Flags => $self->db_flags, @_, ) || die sprintf( 'Could not create BerkeleyDB - "%s" - "%s"', $!, $self->cache_file, ); return $bdb; } sub trunc { my( $self ) = @_; warn sprintf( 'unlink( %s, "%s" ) = "%s"', join( q[, ], map { sprintf( '"%s"', $_ ) } glob( $self->cache_dir . '/__db.*' ) ), $self->cache_file, scalar unlink( $self->cache_file, glob( $self->cache_dir . '/__db.*' ) ), ) if $self->debug; return $self->new( %{ $self }, ); } sub get { my( $self, $key ) = @_; $self->dbm->db_get( $key, my $val ); return $val; } sub set { my( $self, $key, $val ) = @_; my( $dbm ) = $self->dbm; my( $rv ) = $dbm->db_put( $key, $val ); $dbm->db_sync if $self->db_sync; return; } sub list { my( $self ) = @_; my $dbm = $self->dbm; my( $cursor ) = $dbm->db_cursor(); my @keys; my( $k, $v ) = ( '', '' ); while( $cursor->c_get( $k, $v, DB_NEXT ) == 0 ) { push @keys, $k; } return @keys; } sub remove { my( $self, $key ) = @_; my( $rv ) = $self->dbm->db_del( $key ) ; return $rv; } no Moose; 1; __END__ embedded_databases/lib/DBM/MySQL.pm0000644000175000001440000000516110653467204017226 0ustar benusers00000000000000package DBM::MySQL; use Data::Dumper; use DBI; use Moose; extends 'DBM::DAL'; with 'DBM::DALRole'; has 'set_sth' => ( is => 'rw', isa => 'Object', ); has 'get_sth' => ( is => 'rw', isa => 'Object', ); has 'list_sth' => ( is => 'rw', isa => 'Object', ); has 'remove_sth' => ( is => 'rw', isa => 'Object', ); has 'truncate_query' => ( is => 'rw', isa => 'Str', ); sub _init_database { my( $self, $dbm, ) = @_; $dbm->do( 'CREATE TABLE mysql ( vkey VARCHAR( 255 ) PRIMARY KEY, value TEXT )' ); $dbm->do( 'CREATE INDEX key_index ON mysql ( vkey )' ); return; } sub init_dbm { my( $self ) = @_; my $dbm = DBI->connect( 'DBI:mysql:database=test' ) || die "Could not connect $! - $DBI::Errstr"; if( not $dbm->do( 'SELECT COUNT(1) FROM mysql' ) ) { $self->_init_database( $dbm ); } my $set_sth = $dbm->prepare( 'INSERT INTO mysql ( vkey, value ) VALUES ( ?, ? )' ) || confess; my $get_sth = $dbm->prepare( 'SELECT value FROM mysql WHERE vkey = ?' ) || confess; my $list_sth = $dbm->prepare( 'SELECT vkey FROM mysql' ) || confess; my $remove_sth = $dbm->prepare( 'DELETE FROM mysql WHERE vkey = ?' ) || confess; my $truncate_query = 'TRUNCATE TABLE mysql'; $self->set_sth( $set_sth ); $self->get_sth( $get_sth ); $self->list_sth( $list_sth ); $self->remove_sth( $remove_sth ); $self->truncate_query( $truncate_query ); return $dbm; } sub trunc { my( $self ) = @_; warn sprintf( 'delete( "%s" ) = "%s"', $self->truncate_query, $self->dbm->do( $self->truncate_query ), ) if $self->debug; return $self->new( %{ $self } ); } sub get { my( $self, $key ) = @_; my $get_sth = $self->get_sth; $get_sth->execute( $key ); my( $rv ) = $get_sth->fetchrow_array; return $rv; } sub set { my( $self, $key, $val ) = @_; my $rv = $self->set_sth->execute( $key, $val ); return $rv; } sub list { my( $self ) = @_; # warn '$self = ', $self; my( $list_sth ) = $self->list_sth; $list_sth->execute; return map { $_->[ 0 ] } @{ $list_sth->fetchall_arrayref }; } sub remove { my( $self, $key ) = @_; my( $rv ) = $self->remove_sth->execute( $key ) ; return $rv; } no Moose; 1; __END__ sub DEMOLISH { my( $self ) = @_; warn 'DEMOLISH ', $self; my( @sths ) = ( $self->set_sth, $self->get_sth, $self->list_sth, $self->remove_sth ); for my $sth( @sths ) { $sth->finish; undef $sth; } my $dbm = $self->dbm; undef $dbm; warn 'foo'; return; } sub DEMOLISH { no warnings 'all'; my( $self ) = @_; undef $self->{dbm}; return; } embedded_databases/lib/DBM/GDBM.pm0000644000175000001440000000436410653742447017003 0ustar benusers00000000000000package DBM::GDBM; use GDBM_File; use Moose; extends 'DBM::DAL'; with 'DBM::DALRole'; has 'cache_dir' => ( is => 'ro', isa => 'Str', default => '/tmp', ); has 'cache_file' => ( is => 'ro', isa => 'Str', default => sub { $_[0]->cache_dir . '/gdbm' }, ); has 'writer' => ( is => 'ro', isa => 'Bool', default => 0, ); has 'reader' => ( is => 'ro', isa => 'Bool', default => 0, ); has 'create' => ( is => 'ro', isa => 'Bool', default => 0, ); sub init_dbm { my $self = shift; my %args = @_; my $flags = GDBM_READER | GDBM_NOLOCK; # | GDBM_SYNC if( $self->writer ) { # warn 'writer'; $flags = GDBM_WRCREAT | GDBM_NOLOCK; # | GDBM_SYNC } elsif( $self->create ) { # warn 'create'; $flags = GDBM_NEWDB | GDBM_NOLOCK; # | GDBM_SYNC } # else { # warn 'reader'; # } if( not -f $self->cache_file and not $flags & GDBM_NEWDB and not $flags & GDBM_WRCREAT ) { # warn 'updating flags ', $flags & GDBM_WRITER; $flags = $flags | GDBM_NEWDB | GDBM_NOLOCK; } else { # warn 'NOT updating flags ', $flags & GDBM_WRITER, ' ', $flags & GDBM_WRCREAT; } my $gdbm = GDBM_File->new( $self->cache_file, $flags, oct( '0640' ), ) || die sprintf( 'Could not create GDBM_File - "%s" - "%s"', $!, $self->cache_file, ); return $gdbm; } sub trunc { my( $self ) = @_; warn sprintf( 'unlink( "%s" ) = "%s"', $self->cache_file, scalar unlink( $self->cache_file ) ) if $self->debug; return $self = $self->new( create => 1, %{ $self }, ); } sub get { my( $self, $key ) = @_; my $rv = $self->dbm->FETCH( $key ); return $rv; } sub set { my( $self, $key, $val ) = @_; my $rv = $self->dbm->STORE( $key, $val ); return $rv; } sub list { my( $self ) = @_; # warn '$self = ', $self; my @keys; my $dbm = $self->dbm; my $k = $dbm->FIRSTKEY; if( $k ) { do { # warn '$k = ', $k || 'undef'; my $v = $dbm->FETCH( $k ); # warn sprintf( '%s => %s', $k, Dumper( $v ) ); push @keys, $k if $k; } while( $k = $dbm->NEXTKEY( $k ) ); } return @keys; } sub remove { my( $self, $key ) = @_; my $rv = $self->dbm->DELETE( $key ); return $rv; } no Moose; 1; __END__ embedded_databases/lib/DBM/DALRole.pm0000644000175000001440000000016210652701312017465 0ustar benusers00000000000000package DBM::DALRole; use Moose::Role; requires qw[init_dbm trunc get set list remove]; no Moose; 1; __END__ embedded_databases/lib/DBM/CFM.pm0000644000175000001440000000351510653513543016665 0ustar benusers00000000000000package DBM::CFM; use Cache::FastMmap; use Moose; extends 'DBM::DAL'; with 'DBM::DALRole'; has 'cache_dir' => ( is => 'ro', isa => 'Str', default => '/tmp', ); has 'cache_file' => ( is => 'ro', isa => 'Str', default => sub { $_[0]->cache_dir . '/cfm' }, ); has 'raw_values' => ( is => 'ro', isa => 'Bool', default => 1, ); has 'cache_size' => ( is => 'ro', isa => 'Str', default => '20m', ); has 'unlink_on_exit' => ( is => 'ro', isa => 'Bool', default => 0, ); has 'cache_not_found' => ( is => 'ro', isa => 'Bool', default => 1, ); sub init_dbm { my $self = shift; my %args = ( 'share_file' => $self->cache_file, 'raw_values' => $self->raw_values, 'cache_size' => $self->cache_size, 'unlink_on_exit' => $self->unlink_on_exit, 'cache_not_found' => $self->cache_not_found, # 'read_cb' => sub { return undef; }, @_, ); # warn '%args = ', join( "\n", %args ); my( $cfm ) = Cache::FastMmap->new( %args, ) || die sprintf( 'Could not create Cache::FastMmap - "%s" - "%s"', $!, $self->cache_file, ); return $cfm; } sub trunc { my( $self ) = @_; # warn sprintf( '( stat "%s" )[ 7 ] = %s', '/tmp/cfm', ( stat '/tmp/cfm' )[ 7 ], ); warn sprintf( 'unlink( "%s" ) = "%s"', $self->cache_file, scalar unlink( $self->cache_file ) ) if $self->debug; return $self = $self->new( %{ $self } ); } sub get { my( $self, $key ) = @_; my $rv = $self->dbm->get( $key ); return $rv; } sub set { my( $self, $key, $val ) = @_; # warn '$key = ', $key; my $rv = $self->dbm->set( $key, $val ); return $rv; } sub list { my( $self ) = @_; # warn '$self = ', $self; return $self->dbm->get_keys( 0 ); } sub remove { my( $self, $key ) = @_; my $rv = $self->dbm->remove( $key ); return $rv; } no Moose; 1; __END__ embedded_databases/lib/DBM/DAL.pm0000644000175000001440000000033310653462337016657 0ustar benusers00000000000000package DBM::DAL; use Data::Dumper; use Moose; has 'dbm' => ( is => 'ro', isa => 'Any', default => sub { $_[0]->init_dbm; }, ); has 'debug' => ( is => 'rw', isa => 'Bool', default => 0, ); no Moose; 1; __END__ embedded_databases/test_dbm_1.pm0000744000175000001440000001443010653457044017133 0ustar benusers00000000000000package gdbm; use strict; use warnings; use GDBM_File; use constant CACHE_FILE => '/tmp/gdbm'; sub new { my $class = shift; my $gdbm = GDBM_File->new( CACHE_FILE, GDBM_WRCREAT | GDBM_NOLOCK, oct( '0640' ), ) || die "Could not create GDBM_File - $!"; return bless { dbm => $gdbm }, $class; } sub set { my( $self, $key, $val ) = @_; return $self->{dbm}->STORE( $key, $val ); } sub get { my( $self, $key ) = @_; return $self->{dbm}->FETCH( $key ); } sub all_keys { my( $self ) = @_; # warn '$self = ', $self; my @keys; my $k = $self->{dbm}->FIRSTKEY; if( $k ) { do { # warn '$k = ', $k || 'undef'; my $v = $self->{dbm}->FETCH( $k ); # warn sprintf( '%s => %s', $k, Dumper( $v ) ); push @keys, $k if $k; } while( $k = $self->{dbm}->NEXTKEY( $k ) ); } return @keys; } sub init { unlink CACHE_FILE; } package bdb; use strict; use warnings; use BerkeleyDB; use constant CACHE_FILE => '/tmp/bdb'; sub new { my $class = shift; my $bdb = BerkeleyDB::Btree->new( -Filename => CACHE_FILE, -Flags => DB_CREATE ) || die "Could not create BerkeleyDB - $!"; return bless { dbm => $bdb }, $class; } sub set { my( $self, $key, $val ) = @_; $self->{dbm}->db_put( $key, $val ); $self->{dbm}->db_sync; return; } sub get { my( $self, $key ) = @_; $self->{dbm}->db_get( $key, my $val ); return $val; } sub all_keys { my( $self ) = @_; my( $cursor ) = $self->{dbm}->db_cursor(); my @keys; my( $k, $v ) = ( '', '' ); while( $cursor->c_get( $k, $v, DB_NEXT ) == 0 ) { push @keys, $k; } return @keys; } sub init { unlink CACHE_FILE, glob( '/tmp/__db.*' ); } package bdbenv; use strict; use warnings; use base 'bdb'; # This is the only one that works as desired... sub new { my $class = shift; my $env = BerkeleyDB::Env->new( -Home => '/tmp', -Flags => __PACKAGE__->DB_CREATE | __PACKAGE__->DB_INIT_MPOOL, -Mode => oct( '0644' ), ) || die "Could not create BerkeleyDB::Env - '$BerkeleyDB::Error' - '$!'"; my $bdb = BerkeleyDB::Btree->new( -Filename => __PACKAGE__->CACHE_FILE, -Flags => __PACKAGE__->DB_CREATE, -Mode => oct( '0644' ), -Env => $env, ) || die "Could not create BerkeleyDB::Btree - '$BerkeleyDB::Error' - '$!'"; return bless { dbm => $bdb }, $class; } package main; use strict; use warnings; use POSIX(); use IO::Socket::INET; use Time::HiRes(); use constant DBM_PACKAGE => 'gdbm'; # use constant DBM_PACKAGE => 'bdb'; # use constant DBM_PACKAGE => 'bdbenv'; sub all_letters { return ( 'a' .. 'z', 'A' .. 'Z' ); } sub random_sleep { return Time::HiRes::sleep( ( .001, .002, .003, .004, .005, )[ int( rand 5 ) ] ); } sub random_letter { return ( all_letters() )[ int rand 52 ]; } sub start_server_process { my( $socket ) = @_; my $pid = fork; if( not $pid ) { my $db = DBM_PACKAGE->new(); for( 1 .. 200 ) { my $client = $socket->accept; my $output = "$$\n"; for my $k( $db->all_keys ) { my $v = $db->get( $k ); $output .= "$k -> $v\n"; } $client->send( $output ); } # warn $$, ' Server child exiting...'; exit; } return $pid; } sub run { my %options = @_; if( not %options or $options{start} ) { if( $options{daemonize} ) { POSIX::setsid(); fork and exit; } POSIX::setsid; # Listen for UDP packets and add them to the cache. if( not fork ) { DBM_PACKAGE->init; my $dbm = DBM_PACKAGE->new; my $socket = IO::Socket::INET->new( Proto => 'udp', LocalAddr => '127.0.0.1:12345', ReuseAddr => 1, ) || Carp::confess 'No $socket: ', $!; while( 1 ) { $socket->recv( my $message, 4096, ); my $time = time; warn $$, ' adding message ', $message, ' time ', $time; $dbm->set( $message, $time ); } warn $$, ' Listener exiting...'; exit; } warn $$, ' Started listener...'; # Start listening socket in parent. my $socket = IO::Socket::INET->new( Proto => 'tcp', LocalAddr => '127.0.0.1:54321', Listen => 1, ReuseAddr => 1, ) || Carp::confess 'No $socket: ', $!; for( 1 .. 10 ) { # Listen for TCP connections and send them the contents of the cache. warn $$, ' Parent started ', start_server_process( $socket ); } warn $$, ' Started servers...'; if( not $options{noreaders} ) { for ( 1 .. 50 ) { # Make TCP connections to the above listeners for simulated load. if( not fork ) { $SIG{__WARN__} = sub { syswrite( STDERR, sprintf( '%s %s', $$, join( q[, ], @_ ) ) ); }; $SIG{__DIE__} = 'IGNORE'; my $db = DBM_PACKAGE->new(); sleep 1; while( 1 ) { my $socket = IO::Socket::INET->new( PeerAddr => '127.0.0.1:54321', ) || Carp::confess 'No $socket: ', $!; $socket->recv( my $message, 4096 ); random_sleep(); } warn $$, ' Reader child exiting...'; exit; } } warn $$, ' Started readers...'; } else { warn $$, ' Skipped readers...'; } $SIG{__DIE__} = sub { kill 'TERM', -$$; }; while( my $pid = wait ) { last if $pid == -1; warn $$, ' Parent reaped ', $pid; warn $$, ' Parent started ', start_server_process( $socket ); } warn $$, ' Parent exiting...'; exit; } elsif( my $message = $options{message} ) { my $socket = IO::Socket::INET->new( Proto => 'udp', PeerAddr => '127.0.0.1:12345', ReuseAddr => 1, ) || Carp::confess 'No $socket: ', $!; $socket->send( $message || 'default message' ); exit; } elsif( $options{dump} ) { my $socket = IO::Socket::INET->new( PeerAddr => '127.0.0.1:54321', ) || Carp::confess 'No $socket: ', $!; $socket->recv( my $message, 4096 ); print $message, "\n"; } } 1; __END__ embedded_databases/.embedded_databases.vim0000644000175000001440000012720610653745656021125 0ustar benusers00000000000000let SessionLoad = 1 if &cp | set nocp | endif map  :tabp map  :tabn let s:cpo_save=&cpo set cpo&vim nmap gx NetrwBrowseX nnoremap NetrwBrowseX :call netrw#NetBrowseX(expand(""),0) let &cpo=s:cpo_save unlet s:cpo_save set autoindent set background=dark set expandtab set helplang=en set shiftwidth=4 set smartindent set softtabstop=4 set tabstop=4 let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0 let v:this_session=expand(":p") silent only cd ~/documents/perl/embedded_databases if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == '' let s:wipebuf = bufnr('%') endif set shortmess=aoO badd +18 embedded-databases.txt badd +1 lib/DBM/DAL.pm badd +13 lib/DBM/GDBM.pm badd +1 t/01-dbm-dal.t badd +1 lib/DBM/DALRole.pm badd +1 t/10-dbm-gdbm.t badd +19 lib/DBM/BDBWithEnv.pm badd +25 lib/DBM/BDBWithoutEnv.pm badd +20 t/20-dbm-bdbwithoutenv.t badd +23 t/30-dbm-bdbwithenv.t badd +68 lib/DBM/SQLite.pm badd +15 t/40-dbm-sqlite.t badd +21 lib/DBM/MySQL.pm badd +1 t/50-dbm-mysql.t badd +9 t/100-dbm-benchmark.pl badd +1 lib/DBM/CFM.pm badd +1 t/60-dbm-cfm.t badd +4 t/200-app-test.t badd +1 t/300-bench.t args embedded-databases.txt edit embedded-databases.txt set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != '' setlocal filetype= endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != '' setlocal syntax= endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 111 - ((44 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 111 normal! 0 tabnew edit lib/DBM/DAL.pm set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 6 - ((5 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 6 normal! 055l tabnew edit lib/DBM/DALRole.pm set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 4 - ((3 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 4 normal! 040l tabnew edit lib/DBM/GDBM.pm set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 1 - ((0 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 1 normal! 0 tabnew edit lib/DBM/BDBWithoutEnv.pm set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 60 - ((44 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 60 normal! 0 tabnew edit lib/DBM/BDBWithEnv.pm set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 19 - ((18 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 19 normal! 0 tabnew edit lib/DBM/SQLite.pm set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 68 - ((31 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 68 normal! 04l tabnew edit lib/DBM/MySQL.pm set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 21 - ((0 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 21 normal! 04l tabnew edit lib/DBM/CFM.pm set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 1 - ((0 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 1 normal! 0 tabnew edit t/01-dbm-dal.t set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 1 - ((0 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 1 normal! 0 tabnew edit t/10-dbm-gdbm.t set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 1 - ((0 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 1 normal! 0 tabnew edit t/20-dbm-bdbwithoutenv.t set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 20 - ((19 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 20 normal! 0 tabnew edit t/30-dbm-bdbwithenv.t set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 23 - ((22 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 23 normal! 0 tabnew edit t/40-dbm-sqlite.t set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 15 - ((14 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 15 normal! 0 tabnew edit t/50-dbm-mysql.t set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 1 - ((0 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 1 normal! 0 tabnew edit t/60-dbm-cfm.t set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 1 - ((0 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 1 normal! 0 tabnew edit t/200-app-test.t set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 4 - ((3 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 4 normal! 0 tabnew edit t/300-bench.t set splitbelow splitright set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 argglobal setlocal noarabic setlocal autoindent setlocal autoread setlocal nobinary setlocal bufhidden= setlocal buflisted setlocal buftype= setlocal nocindent setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e setlocal cinoptions= setlocal cinwords=if,else,while,do,for,switch setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- setlocal commentstring=/*%s*/ setlocal complete=.,w,b,u,t,i setlocal completefunc= setlocal nocopyindent setlocal nocursorcolumn setlocal nocursorline setlocal define= setlocal dictionary= setlocal nodiff setlocal equalprg= setlocal errorformat= setlocal expandtab if &filetype != 'perl' setlocal filetype=perl endif setlocal foldcolumn=0 setlocal foldenable setlocal foldexpr=0 setlocal foldignore=# setlocal foldlevel=0 setlocal foldmarker={{{,}}} set foldmethod=marker setlocal foldmethod=marker setlocal foldminlines=1 setlocal foldnestmax=20 setlocal foldtext=foldtext() setlocal formatexpr= setlocal formatoptions=tcq setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* setlocal grepprg= setlocal iminsert=0 setlocal imsearch=0 setlocal include= setlocal includeexpr= setlocal indentexpr= setlocal indentkeys=0{,0},:,0#,!^F,o,O,e setlocal noinfercase setlocal iskeyword=@,48-57,_,192-255 setlocal keymap= setlocal keywordprg= setlocal nolinebreak setlocal nolisp setlocal nolist setlocal makeprg= setlocal matchpairs=(:),{:},[:] setlocal modeline setlocal modifiable setlocal nrformats=octal,hex setlocal nonumber setlocal numberwidth=4 setlocal omnifunc= setlocal path= setlocal nopreserveindent setlocal nopreviewwindow setlocal quoteescape=\\ setlocal noreadonly setlocal norightleft setlocal rightleftcmd=search setlocal noscrollbind setlocal shiftwidth=4 setlocal noshortname setlocal smartindent setlocal softtabstop=4 setlocal nospell setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ setlocal spellfile= setlocal spelllang=en setlocal statusline= setlocal suffixesadd= setlocal swapfile setlocal synmaxcol=3000 if &syntax != 'perl' setlocal syntax=perl endif setlocal tabstop=4 setlocal tags= setlocal textwidth=0 setlocal thesaurus= setlocal nowinfixheight setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 let s:l = 70 - ((44 * winheight(0) + 22) / 45) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 70 normal! 0 tabnext 9 if exists('s:wipebuf') silent exe 'bwipe ' . s:wipebuf endif unlet! s:wipebuf set winheight=1 winwidth=20 shortmess=filnxtToO let s:sx = expand(":p:r")."x.vim" if file_readable(s:sx) exe "source " . s:sx endif let &so = s:so_save | let &siso = s:siso_save doautoall SessionLoadPost unlet SessionLoad " vim: set ft=vim : embedded_databases/embedded-databases.ppt0000644000175000001440000010200010653661106020741 0ustar benusers00000000000000ࡱ; ?>  !"#$%&'()*+,-./0123456789:;<=@Root Entry  dO)MS PowerPoint 97`C`CX'dd AEԣ@DD$_Po Current User9C9C :CD:Cd:COh+'0`GHf  3  " ---. ""-3f-8""f-8L""LL8""- f"Albany-"2 tNEmbedded Databases 4####*#!' Thorndale-32 Ben Bixby - Seevast.com, Inc.     ( !''՜.+,D՜.+,L(T\ _PID_GUID _PID_HLINKSAN{DB1AC964-E39C-11D2-A1EF-006097DA5689}A%http://perlmonks.org/?node_id=629253x+(O  Hhttp://perlmonks.org/?node_id=629253Hhttp://perlmonks.org/?node_id=629253zhttp://conferences.oreillynet.com/cs/os2007/view/e_sess/12585zhttp://conferences.oreillynet.com/cs/os2007/view/e_sess/12585Xhttp://cpan.robm.fastmail.fm/cache_perf.htmlXhttp://cpan.robm.fastmail.fm/cache_perf.html/ 00DTimes New RomanDArial DHG Mincho Light J;MS Mincho;HG 0DStarSymbolf  @n?" dd@  @@`` ,$`J     c $@> g4UdUdUdUd ppp@ <4 g4;d;d;d;d (p@ pp^"$Embedded Databases -  <Ben Bixby - Seevast.com, Inc. \8 %-u8 %-u& &   2Embedded Databases -Intro -  What is an embedded database? Runs in the same process How do they work? Usually can talk binary format directly What are the advantages? Speed No longer have to communicate with external process (IPC/Network) Context switching Local database means app server has to switch back and forth Can move load from central RDBMs to frontend app servers@%- K%-( K%- KB%- K=%-9%-(B=9 Z 2Embedded Databases -Intro -  What are the disadvantages Concurrency There are consequences of running an in-process DB in multiple processes Synchronization Need a mechanism to synchronize processes when data changes RDBMs have this built in Locking Locking in high performance apps not an option%-  KI%- K<%-%- K/%- I</  2Embedded Databases -Intro -  "Why/When would you want to use one If your application has/needs a database server running locally Many reads, few writes Zero writes if possible#%-@ K K%-#@  :Embedded Databases -Avaliable -  Some available embedded databases BerkeleyDB Cache::FastMmap Embedded MySQL * File System GDBM_File SQLite"%-  K K K  K  K K"   k  2Embedded Databases -Using -  vUsing embedded databases Code should be abstract Might want to swap database type Some are better than others for certain purposes Some considerations Performance Correctness Concurrency%- K! K1 K K %- %- %-!1     :Embedded Databases - Abstract -  FAbstract embedded database code Data Access Layer (DAL) Essentially a tied hash interface As long as it has these basic functions Init Get Set List Remove Truncate@ %- K" K( K%-%-%-%-%- %- "(    8Embedded Databases  Correct -  lCorrectness Does the database do what you need how you need Does it have the features you need LRU SQL Synchronization Automatic resizing Corruption recovery Does it work as expected  %-0 K# K%-%-%-%-%- K 0#   8Embedded Databases - Concur. -  Concurrency Special considerations for a multi-process environment Readers Writers Locking Synchronization %-7 K K K K K 7 k   4Embedded Databases - Perf. -  Performance comparison Is it fast enough for your application Benchmarking`%-' K  K'  K  4Embedded Databases -Concl. -  Conclusion Get requirements straight Reduce pain Some additional info MJD - "Lightweight Database Techniques" - http://perlmonks.org/?node_id=629253 Michael Owens - "Programming with SQLite" - http://conferences.oreillynet.com/cs/os2007/view/e_sess/12585 Rob Mueller - "Comparison of Different Perl Caching Modules" - http://cpan.robm.fastmail.fm/cache_perf.html Thank you %- K  K KO%-j%-l%-  K  *%,>?- p>k u /4  P` ̙33` ` ff3333f` 333MMM` f` f` 3?-u(f} -d,} -d,} -d,} -d,?%-uD }  Ku k} %-u0}  Ku@} %-uP ?" dd }  dd  } " dd@ }  dd` } dd @?%-u} %-d} %-d} %-d } %-d P}%-u }%-d}%-d}%-d }%-d `}" dd,} dd ,}" dd@,} dd`,}dd,p}" dd } dd }" dd@} dd`}dd}" dd } dd }" dd@} dd`}dd D<(  ^"  6Ghff j^"  6Ghff -"   `$0z3f̙   zFClick to edit the title text format$ $   `0z3f̙ h  Click to edit the outline text format Second Outline Level Third Outline Level Fourth Outline Level Fifth Outline Level Sixth Outline Level Seventh Outline Level Eighth Outline Level Ninth Outline Level6& N  63f̙qљYs ? ̙33  :(  ^  S  ?;_     HD1z    H  0޽h ? ̙33  `X0 (      N1z    F2 X  x @   N2z i  J6 X  x @`<  c $qљqљ ? ̙33  `X@(     Nd2z    F2 X  x @   N2z Ns  J6 X  x @`<  c $qљqљ ? ̙33  `XP(     N$3z    F2 X  x @   N3z i  J6 X  x @`<  c $qљqљ ? ̙33  `X`(     N3z    F2 X  x @   ND4z i  J6 X  x @`<  c $qљqљ ? ̙33  `Xp(     N4z    F2 X  x @   N5z i  J6 X  x @`<  c $qљqљ ? ̙33  `X (      Nd5z    F2 X  x @   N5z i  J6 X  x @`<  c $qљqљ ? ̙33  `X$(  $ $  N$6z    F2 X  x @ $  N6z i  J6 X  x @`< $ c $qљqљ ? ̙33  `X((  ( (  N6z    F2 X  x @ (  ND7z i  J6 X  x @`< ( c $qљqљ ? ̙33  `X,(  , ,  N7z    F2 X  x @ ,  N8z i  J6 X  x @`< , c $qљqљ ? ̙33   `X0(  0 0  Nd8z    F2 X  x @ 0  N8z i  J6 X  x @`< 0 c $qљqљ ? ̙33   `X4(  4 4  N$9z    F2 X  x @ 4  N9z i  J6 X  x @`< 4 c $qљqљ ? ̙33 ~8(  8^ 8 S  ?;_   x 8 c $     H 8 0޽h ? ̙33 ~<(  <^ < S  ?;_   x < c $     H < 0޽h ? ̙33 ~@(  @^ @ S  ?;_   x @ c $     H @ 0޽h ? ̙33 ~D(  D^ D S  ?;_   x D c $     H D 0޽h ? ̙33 ~ H(  H^ H S  ?;_   x H c $     H H 0޽h ? ̙33 ~0L(  L^ L S  ?;_   x L c $     H L 0޽h ? ̙33 ~@P(  P^ P S  ?;_   x P c $     H P 0޽h ? ̙33 ~PT(  T^ T S  ?;_   x T c $     H T 0޽h ? ̙33 ~`X(  X^ X S  ?;_   x X c $     H X 0޽h ? ̙33  ~p\(  \^ \ S  ?;_   x \ c $     H \ 0޽h ? ̙33  ~`(  `^ ` S  ?;_   x ` c $     H ` 0޽h ? ̙33rh+$:<>ADVG&JLORfU6X[\^p`>b degviDkm n(06^E06^E q  |Mz0 !#p%&y)8,.02(4(4 6^E?4R%>http://conferences.oreillynet.com/cs/os2007/view/e_sess/12585-http://cpan.robm.fastmail.fm/cache_perf.htmlRoot EntrydO)CompObj9Ole Current User,PicturesSummaryInformation(PowerPoint Document(toDocumentSummaryInformation8embedded_databases/embedded-databases.sxi0000644000175000001440000002711510653745705020766 0ustar benusers00000000000000PK־6Xmimetypeapplication/vnd.sun.xml.impressPK־6=s__-Pictures/1000000000000040000000400142E835.pngPNG  IHDR@@% &IDATxQ D!<7ӛ6(,Ly_Io]@.@C4@C4@C4@C4躮Vqq$y) (eėA/{ xB?b,*}>XHR`=@L@o1([=F#h/? ̹Sh~ R@ܻbxrEPя^nZzd_$pF>L_f g Jq. |    yƂ_޼B|1 G`S(\?\*)~ȡ\t?Övռ8ξ9Rgǰǔb!\ d]^6I.l֒{6ǽU|ؾF{+f,qdyr8>;l^Œ`'p 8 XjYpxQt;$[`c(ޗmWQ^իjѬcxTbӜǠ|PH}6 ^Wuyq%a!7=}BvH: 8 2h;zfJ>1.,B}d1I>1ٔKt mXb"R1!¾^k+_͝`e~p.t#CdЧt\Fݡ@߽*| R ?o w\ݺ$Ps6t,a\Dp ]mYBVR'A@ Oh Xx 0 ƙt}yqj8{ JA,NW;ܯ4+g~~NXM3qMoa:Ԥa uOZ[``mCJ2wR%^J$xnO󒟾o9@ z!}a}*{&=p͡.m9p66 {g!Eda]P]JEEbфh= QNʒiKKחit吳w0n=}ۿU|Ga{Gח_GX$4L5SfLq]X[kSS,&g3KԸ^1 ٰpޖ[Cխ2ly~L:zVDQD!\ őEGAU}CupReuè?iՎym9KZG_:ܡC=6;iƘCS`,vVE K3z: }w}qZ=jV(;2#I,DՇBɎP kʨ:ɁTڡo4~ӭ%G$Ch1BBރfD !DTcB8,U:Ag jciM%+Lej 5kFDT:̧mzUގ97e:YFUme&t J}VTJB!47O#FaNR8ٟn_q8_3%s2ΛɁ: $H4s2'Wyӂ?d6rK'27 vLBžD_&o._A6zu/`'I2y1+[5*m%V(QmdլUX}:}0m&ef'v2@WDPUAt:6UuWAOcq7-Q5 Vpdu4ldQ(ֵ8}3:DůQ/j;ģ&V*gjMfe.gV2+Eƫ=K(B^|( fڨ:u˳^? >QyM2kW١*O{D*2_eߤDJ%L`Ƭݦ9k1fVlzPKhUPK־6 styles.xmlݒĩ*`ߝٝMOv*r {oJ"/7ɛ 9_m.V%$Wa{4$YӼ!.׽wWoob%:DOV^oe߽ﳃ4L_zZ/=&n훆sQ|V^$Y]BئiϽ~tk{B4OǤ5k7Fg[.EYh y뇇a[Z٬ۛw(1їV4ܣ햠^ >@Z}p,}mw>oQs>΁+LM{59-O)M|ȧ#6M)B!IC};eU^ W:G8yLA5(Z uٸV"̗VѤh *1 j0+gZ`{7F 3s_mE8;[!f8KQU=*d(q|Y 1fjGȈ#fef[ q|w8 cqʧ. ;_2a_kh;iMW<'Px]Q($!B;oP+DaU[?zAW1puow$.@Omne\(OV8pX3LlSi9\+LXolwZ64K'fVZP=N(.KS=\1s1H[|xђæacUvвi1ȯ|z 2VҲ qbNWVh`P ;Elvf-j%8bE+ w(N!P8ƿ{pk0ߢ^j:J(\m%Q?#h7x'ڏiorqqԏM7 8$]S݅IgKkUk'uwv CC%>GOx[Y;Eّiٛ}-zqt RH *y@8bH17?Iymѵ,y:!4ƮGQs_`5X3 s!Hx :a'V=6P=r1dCW#A^T$P9я"QC)*E"МU<`BZI=0q1chc WnHp53)kRX:kMoŹOC 8K}#є]XP+,\T[)MM%`Z$YW碴q 넍ܫRCIЖӪX}QT3VGmR?8k)+!K#[/a#RhK&O|?+ONxyIScE`Bvp8EA{A:DK+Y9g1m(u >s}ٕ4Yv<.soA(1&dcjyTgbkv;armc):%vr؎ar TCv+P1v=D2"TRsLD?{N%Iح2֖yUMdX]ݿ kҞaqmO*@U+r*@UujzE5zc<ϟO8hE"E*\E"E*|]I {2%02}Ăo+SXO^W*SXOk`=vNTħO">E|O"WM|s>*ʭ*Q$HP"U$HP"D?d(2+מ%xPQBEPQBE q흇 | ѩ0.i(+TRŋURHH/a=pv* T! * Tj0:)=}n/)~65Rܟ\9XlwoUT(UQU(UQWC)(.tg0V(VQXE(VQWK\guծ"AE$W"AE_ v>Sů`\  *@\  *@|Mx==q("?u'(Fō7*nXō7Zn =0_ Q8@78^E5 >fpLFu-j nšCvHPšCϿ-d omo~uH*CFu_AO F0CQ,Ϛ|_+U-hIV"ouD-_%j"QmO ~kO}?Ԋz1G &Ѿyi @|M)/^iH/x,LaGd׽ bTP8Z6@:i%RID&=\_BBR#<|ە~/ !5]R̈˲JwdW[YGp 3]3%ɋ0{z|IyT:~.b_4j{vfQ۫tKmmaP۫uKmmgP۫tKmm E=bFQx=??|Ke|B#I#UJBBT#BCTg*İږ_V9e93&\3μpY8Ne3b\3μi~#˒|˫evyNʯKhY~7 _Ϟd]cJʦ;sI=s]3ln]#i7ftϓo)%t}$h %gHIZ+.a3&(/9ɸO޷'C񓌋Cq`>>UzgONWwLv6D<\(LY7h$ -qӘTa&XYymah3a/Ch!fݙ;03˪#scmt+ac;{'v MBsG"ñ!P!G='dU<랕IW(N׀Jaҕhό\,`l°h`u;h%HWL:^IzI^ZY7*^Pv 6ۥb7n u#d_S]Wj<phxY<$s[{+;a;MW7"y)q;XTnު_Ց:%:kk`^x_@+L]F*<1rd*g"~t m_k 0yM:ŲQ13ٚ4YRl|)b]ٲ99y,O;c}ŹҮKLSa(Mf`*'@qug>X<ơ1jybZDB9*rҼo`VrL|e.|$W}MȘM'UaNI[yŘ( 81lRʑ1-9A& O;a!xyF9`TR70R6ePF3;?4Ft~Z%LCCj?9<(K .b80'PKU-bPK־6^Hmeta.xml OpenOffice.org 1.1.4 (Linux)2007-07-31T11:37:352007-07-31T19:54:44en-US2PT29M14SPK־6 settings.xmlZr8}߯򺕀df<ɔ=8`M3%DW;'vS V.ݍϿrXSMZ>iS}E~e[z{;K8@Es7 fרhG~"r;լdͭXEzkU vq~]hIY7myUשࡏ<50Y c'Ir}z]O[w]C"A yjWv ;+bU= ߍ<>9 1*ۯ |Iz->৵7Wy'>Vתލ'.G>Jʈ6%=wO͈31 9/ |m#H[#T(ٷ:gqA^4!0$Q~=tHz9ė XCRf Qp7 gɠ7+ N O GC7 $]޶T=3 z% mчq}:5l].CCroѦO5rVEj@RA1}b>1bo7VC2t bGCP^N+ټLnJ4Nl`Y[螷\_4VxhLwag}EC4wisqE!C2J4PgLW0∽W3ğ]\W.&4d <=  #pqnQ>;u_JdK Yj_}.8_^-A?C>u)hUQ4AbةA 9eL3o"B>tqjыlJҴLTT $mAipMrBw9_>9jޖ;DX=, ~j obMG -9 ڭWh%"wz|Bɭz L#,qyk@֜eZ}hʑ&v*ӫ J܂j[c.4H"qﺈm̼sxc` /C ~7xh+r{~Iھ ɘ/U#IMîգz17 46&N,/B6 Ѵ5n.kRU˞W l!^ nebFS`ށ,=]iЗ*u)/Maжd)8MϝW;RhD>8)p\Ġ{dI<끿&ɞ[*A =*$ok ļz<ۏ)4OϵOA`(g"\|-"\#I3|Oړ'qbezg~ = iplʋ]ĬN킿l#EX(q`QsI/G/PKBKr*PK־6META-INF/manifest.xml0ٹ7Ӻ.X.,ch5ЦE~VPX20d8Օ8RtcbdLڔ1l`5Y/f%jetAFl_KڒYH6m<q 9gzS]10®ȃDO*tEn7)*೥[R׶%*UX)]К1n3>x55c4&oxN'iL'F?Ԭ1/\[2W3{?PKSVClPK־6XmimetypePK־6=s__-EPictures/1000000000000040000000400142E835.pngPK־6hU content.xmlPK־6U-b }styles.xmlPK־6^Hmeta.xmlPK־6BKr* #settings.xmlPK־6SVCl$+META-INF/manifest.xmlPK,embedded_databases/embedded-databases.txt0000644000175000001440000000601310653745604020772 0ustar benusers00000000000000Embedded Databases - Ben Bixby ------------------ Intro What is an embedded database? Runs in the same process How do they work Usually can talk binary format directly What are the advantages Speed No longer have to communicate with external process (IPC/Network) Context switching Local database means app server has to switch back and forth Can move load from central RDBMs to frontend app servers Simplicity Desktop apps No/Limited administration What are the disadvantages Concurrency There are consequences of running an in process DB in multiple processes Synchronization Need a mechanism to synchronize processes when data changes RDBMs have this built in Locking Locking in high performance apps not an option Why/When would you want to use one If your application has/needs a database server running locally Many reads, few writes Zero writes if possible Some available embedded databases BerkeleyDB Cache::FastMmap Embedded MySQL File System GDBM_File SQLite Using embedded databases Code should be abstract Might want to swap database type Some are better than others for certain purposes Some considerations Performance Correctness Concurrency Abstract embedded database code Data Access Layer (DAL) Essentially a tied hash interface As long as it has these basic functions init get set list remove truncate Correctness Does the database do what you need, how you need Does it have the features you need Does it work as expected Features LRU Cache::FastMmap SQL SQLite Embedded MySQL Synchronization BerkeleyDB With Environment SQLite Embedded MySQL? All others - reinstantiate Automatic resizing SQLite GDBM_File BerkeleyDB File System Embedded MySQL Corruption recovery BerkeleyDB Embedded MySQL? Locking All have locking to some extent Concurrency Special considerations for a multi-process environment Readers Writers Locking Synchronization Performance comparison Is it fast enough for your application Benchmarking Conclusion Get requirements straight Reduce pain Some additional info MJD - "Lightweight Database Techniques" - http://perlmonks.org/?node_id=629253 Michael Owens - "Programming with SQLite" - http://conferences.oreillynet.com/cs/os2007/view/e_sess/12585 Rob Mueller - "Comparison of Different Perl Caching Modules" - http://cpan.robm.fastmail.fm/cache_perf.html Thank you Notes SQL vs Hash based DBM Emphasis on application needs Enumerate cache idiosyncracies