The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Tie::LevelDB - A Perl Interface to the Google LevelDB NoSQL database


  use Tie::LevelDB;

  tie my %hash, 'Tie::LevelDB', "/tmp/testdb";
  # Use the %hash array
  untie %hash;

  -- OR --

  use Tie::LevelDB; 

  my $db = new Tie::LevelDB::DB("/tmp/testdb");
  $db->Put("Google","Don't be evil!");
  print $db->Get("Google")."\n";

  my $batch = new Tie::LevelDB::WriteBatch;
  $batch->Put("Microsoft","Where Do you Want to Go Today?");

  my $it = $db->NewIterator;
  for($it->SeekToFirst;$it->Valid;$it->Next) {
     print $it->key.": ".$it->value."\n";


Tie::LevelDB is the Perl Interface for Google NoSQL database called LevelDB. See for more details.

Interface is implemented both as a reflection of an original LevelDB C++ API and a Perl-ish TIEHASH mechanism.


None by default.


LevelDB does not support storing of undef values. If undef is stored, the key is deleted instead.

Perl support for Options specification is not covered.

To use SNAPPY compression method, install it from first and then re-install this module.

LevelDB sources (version 2011-07-29) are bundled with this packages.

SEE ALSO, DB_File(3), tie.


Martin Sarfy, <>


Copyright (C) 2011 by Sokordia, s.r.o.,

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.