12.09.2023

Installing LevelDB on CentOS

 

LevelDB — is high-performance NoSQL database for
storaging data in key/value format developed by Google.

Requirements

Installing LevelDB

Let's install archiver utility:

yum install leveldb snappy

Using this command, we installed LevelDB, now let's test its perfomance. For this we need Python-pip.

Installing Python-pip:

yum --enablerepo=extras install epel-release
yum install python-devel python-pip gcc-c++

Let's install interface for interacting withLevelDB:

pip install leveldb-cli

Now let's test it. Create a new database:

leveldb create -d newdb.db

Let's insert the key named 'hello' with value 'world' into it:

leveldb put hello centos -d newdb.db

Let's get the value 'hello':

leveldb get hello -d newdb.db

Output:
centos

Let's delete the key 'hello':

leveldb delete hello -d newdb.db

Let's try to get the key 'hello':

leveldb get hello -d newdb.db

Output:
Error: key hello does not exist

In general, it should look like this:

Screenshot № 1. Interface for interacting with LevelDB