Available replacements for the deprecated Berkeley DB (libdb) in RHEL
The libdb package is deprecated as of Red Hat Enterprise Linux (RHEL) 9 and might not be available in future major RHEL releases (RHEL 10 or later). Users of libdb are advised to migrate to a different key-value database. This article suggests replacements for libdb in RHEL.
RHEL 8 and RHEL 9 currently provide libdb 5.3.28, which is distributed under the LGPLv2 license. The upstream Berkeley DB version 6 is available under the AGPLv3 license, which is more restrictive and many projects cannot use it.
Berkeley DB (libdb) is mostly used as a key-value store. RHEL provides multiple alternatives, all of which are available for the following architectures:
- AMD and Intel 64-bit architectures
- the 64-bit ARM architecture
- IBM Power Systems, Little Endian
- 64-bit IBM Z
NOTE: Do not try to remove the libdb package from RHEL 9 and earlier because other packages require it.
Solutions that do not require running a database server
GDBM
GNU dbm (GDBM) is a GNU database indexing library, which includes routines that use extensible hashing. GDBM works in a similar way to standard UNIX dbm routines. GDBM is useful for developers who write C applications and need access to a simple and efficient database or who build C applications that use such a database.
License: Content from www.gnu.org is not included.GNU GPLv3
Limits - search key length: No limit except the data type that is used for holding the key and data lengths (int).
Read-only access to DB: Multiple processes can read a single database. Exclusion control is managed through a reader/writer lock. For more information, see the Content from www.gnu.org.ua is not included.upstream documentation.
Tokyo Cabinet
Tokyo Cabinet is a library of routines for managing a database. It is a successor of Quick Database Manage (QDBM). Tokyo Cabinet is very fast and scalable. The database size is very small and can be up to 8 EB.
License: Content from www.gnu.org is not included.GNU LGPL
Limits - search key length: No limit except the data type that is used for holding the key and data lengths (int).
Read-only access to DB: Multiple processes can read a single database. Exclusion control is managed through a reader/writer lock.
SQLite
SQLite is a C library that implements an SQL database engine. A complete database is stored in a single disk file. The API is designed for convenience and ease of use.
License: Content from www.sqlite.org is not included.Public Domain
Limits - maximum length of an SQL statement: The maximum number of bytes in the text of an SQL statement is limited by the SQLITE_MAX_SQL_LENGTH parameter which defaults to 1,000,000,000. See more information about size limits in the Content from www.sqlite.org is not included.upstream documentation.
Concurrency: See detailed information in the Content from www.sqlite.org is not included.upstream documentation.
Solutions that require an easy-to-use database server
Redis
Redis is an advanced key-value store. It is often referred to as a data-structure server because keys can contain strings, hashes, lists, sets, and sorted sets. You can run atomic operations on these types, such as:
- appending to a string
- incrementing the value in a hash
- pushing to a list
- computing set intersection, union, and difference
- getting the member with the highest ranking in a sorted set.
For performance, Redis works with an in-memory dataset. You can persist Redis either by dumping the dataset to disk regularly, or by appending each command to a log. Redis also supports trivial-to-setup master-slave replication with a fast non-blocking first synchronization and an auto-reconnection on net split. Other features include Transactions, Pub/Sub, Lua scripting, Keys with a limited time-to-live, and configuration settings to make Redis behave like a cache. You can use Redis from most programming languages.
License: Content from opensource.org is not included.BSD and Content from opensource.org is not included.MIT
Limits - maximum key length: The maximum allowed key size is 512 MB. For more information, see the Content from redis.io is not included.upstream documentation.
Concurrency: Redis Modules API features allow concurrent query processing. Redis is single-threaded, but modules can be multi-threaded. See more information about Content from redis.io is not included.distributed locks and Content from redis.com is not included.modules in the upstream documentation.
Memcached
Memcached is a high-performance, general-purpose, distributed memory-caching system. Memcached servers as an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.
License: Content from opensource.org is not included.BSD
Limits - maximum key length: The maximum length of the key in Memcached is restricted to 250 bytes.
Concurrency: To prevent concurrency, Memcached provides CAS (check and set) method. Memcached can obtain the corresponding value at get time and the token (or version number) corresponding to the current key at the same time. See the Content from github.com is not included.upstream documentation for more information.
Solutions that require a database server with more complex administration
Note that this might not be a suitable option for all applications that currently use libdb.
MariaDB
License: Content from www.gnu.org is not included.GNU LGPL
RHEL 8 documentation: Using MariaDB
PostgreSQL
License: Content from www.gnu.org is not included.GNU LGPL
RHEL 8 documentation: Using PostgreSQL