SimpleCDB 1.0
Sponsored Links
SimpleCDB 1.0 Ranking & Summary
File size:
0.015 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
893
Date added:
2007-05-14
Publisher:
Benjamin Low
SimpleCDB 1.0 description
SimpleCDB - A Perl-only Constant Database.
SYNOPSIS
use SimpleCDB;
# writer
# - tie blocks until DB is available (exclusive), or timeout
tie %h, SimpleCDB, db, O_WRONLY
or die "tie failed: $SimpleCDB::ERRORn";
$h{$k} = $v;
die "store: $SimpleCDB::ERROR" if $SimpleCDB::ERROR;
untie %h; # release DB (exclusive) lock
# reader
# - tie blocks until DB is available (shared), or timeout
tie %h, SimpleCDB, db, O_RDONLY
or die "tie failed: $SimpleCDB::ERRORn";
$v = $h{$i};
die "fetch: $SimpleCDB::ERROR" if $SimpleCDB::ERROR;
untie %h; # release DB (shared) lock
This is a simple perl-only DB intended for constant DB applications. A constant DB is one which, once created, is only ever read from (though this implementation allows appending of new data). That is, this is an "append-only DB" - records may only be added and/or extracted.
Course-grained locking provided to allow multiple users, as per flock semantics (i.e. write access requires an exclusive lock, read access needs a shared lock (see notes below re. perl < 5.004)). As (exclusive) updates may be take some time to complete, shared lock attempts will timeout after a defined waiting period (returning $! == EWOULDBLOCK). Concurrent update attempts will behave similarly, but with a longer timeout.
The DB files are simple flat files, with one record per line. Records (both keys and values) may be arbitrary (binary) data. Records are extracted from these files via a plain linear search. Unsurprisingly, this search is a relatively inefficient operation. To improve extraction speed, records are randomly distributed across N files, with the average search space is reduced by 1/N compared to a single file. (See below for some example performance times.) One advantage of this flat file based solution is that the DB is human readable (assuming the data is), and with some care can be edited with a plain ol text editor.
Finally, note that this DB does not support duplicate entries. In practice, the first record found matching a given key is returned, any duplicates will be ignored.
SYNOPSIS
use SimpleCDB;
# writer
# - tie blocks until DB is available (exclusive), or timeout
tie %h, SimpleCDB, db, O_WRONLY
or die "tie failed: $SimpleCDB::ERRORn";
$h{$k} = $v;
die "store: $SimpleCDB::ERROR" if $SimpleCDB::ERROR;
untie %h; # release DB (exclusive) lock
# reader
# - tie blocks until DB is available (shared), or timeout
tie %h, SimpleCDB, db, O_RDONLY
or die "tie failed: $SimpleCDB::ERRORn";
$v = $h{$i};
die "fetch: $SimpleCDB::ERROR" if $SimpleCDB::ERROR;
untie %h; # release DB (shared) lock
This is a simple perl-only DB intended for constant DB applications. A constant DB is one which, once created, is only ever read from (though this implementation allows appending of new data). That is, this is an "append-only DB" - records may only be added and/or extracted.
Course-grained locking provided to allow multiple users, as per flock semantics (i.e. write access requires an exclusive lock, read access needs a shared lock (see notes below re. perl < 5.004)). As (exclusive) updates may be take some time to complete, shared lock attempts will timeout after a defined waiting period (returning $! == EWOULDBLOCK). Concurrent update attempts will behave similarly, but with a longer timeout.
The DB files are simple flat files, with one record per line. Records (both keys and values) may be arbitrary (binary) data. Records are extracted from these files via a plain linear search. Unsurprisingly, this search is a relatively inefficient operation. To improve extraction speed, records are randomly distributed across N files, with the average search space is reduced by 1/N compared to a single file. (See below for some example performance times.) One advantage of this flat file based solution is that the DB is human readable (assuming the data is), and with some care can be edited with a plain ol text editor.
Finally, note that this DB does not support duplicate entries. In practice, the first record found matching a given key is returned, any duplicates will be ignored.
SimpleCDB 1.0 Screenshot
SimpleCDB 1.0 Keywords
SimpleCDB
DB
Constant Database
ERROR
SimpleCDB 1.0
Database
tie
h
constant
lock
files
timeout
SimpleCDB 1.0
Libraries
Programming
Bookmark SimpleCDB 1.0
SimpleCDB 1.0 Copyright
WareSeeker periodically updates pricing and software information of SimpleCDB 1.0 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of SimpleCDB 1.0 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
constantine carpet
yeng constantino
constant chatter
constant contact
constantine the great
vacheron constantin
constant motion
constant focus
constanta
constantine
constantin brancusi
constantine movie
constantinos
constantinople
constant burping
constant sorrow
plancku0027s constant
constant contact login
Related Software
File::LckPwdF is a Perl module to lock and unlock the passwd and shadow files with lckpwdf and ulckpwdf. Free Download
DBIx::Simple provides a simplified interface to DBI, Perls powerful database module. Free Download
Tie::UrlEncoder is a Perl module for interpolatably URL-encode strings. Free Download
p0f-db project is a modified version of p0f that puts its data into a database. Free Download
man-db is a manual page browser. Free Download
Tie::DB_Lock Perl module can ties hashes to databases using shared and exclusive locks. Free Download
Basset::DB::Table is used to define database tables, ways to load that data into memory. Free Download
fileschanged is a command line utility for monitoring files for alterations. Free Download
Latest Software
Popular Software
Favourite Software