Ndbm

Ndbm

ndbm (standing for New Database Manager) is a Berkeley produced version from 1986 of the AT&T dbm database.

ndbm stores arbitrary data by use of a single key in fixed-size buckets.

Problems

The sum of the sizes of a key/content pair must not exceed the internal block size (normally between 512 and 4096 bytes). Moreover all key/content pairs that hash together must fit on a single block.

Discussion

When storing an entry, dbm_store() stores the data in the block that corresponds to the hash of the key. If two or more keys hashes to the same value, all data for those keys must be stored in the same data block. dbm_store() is supposed to return an error in the event that a disk block fills up, but there are situations where it doesn't, and you could just end up quietly delete another entry.

Since you do not which keys hash together, you may not depend on they hash to different buckets. If you are unlucky, all your keys could hash to the same hash value and therefor all your data and some unknown internal metadata must fit in one bucket, which is one block (normally 512-4096 bytes).

This means that the entire database is only guaranteed to be fully stored and retrievable if it the entire dataset including some internal metadata fits in one disk block. If you store more data than that, some data may in some situations just quietly disappear.

Obviously, because of this, if you are interested in being able to retrieve the data you have save, ndbm should not be used, and almost any other storage format is better than ndbm.

The problem is very seldom mentioned in the documentation. One of the few places is a note in the Solaris ndbm(3C) man page.[1]

Still, for historical reasons, ndbm is delivered with several operating systems and used by several programs and systems out there.

References


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • DBM (Datenbank) — Die Datenbank DBM war der erste Vertreter einfacher, dateibasierter Datenbanksysteme. Sie wurde ursprünglich von Ken Thompson entwickelt und im Jahr 1979 von AT T veröffentlicht.[1] Der Name ist ein Akronym für database manager. DBM speichert… …   Deutsch Wikipedia

  • Dbm — For other uses, see DBM (disambiguation) dbm was the first of a family of simple database engines, originally written by Ken Thompson and released by AT T in 1979 [ATT79] . The name is a three letter acronym for database manager .dbm stores… …   Wikipedia

  • Dbm — a été le premier d une famille de moteurs simples de base de données, à l origine écrit par Ken Thompson et publié par ATT en 1979. Le nom est un acronyme de trois lettres de gestionnaire de base de données (DataBase Manager). dbm stocke des… …   Wikipédia en Français

  • dbm — This article is about the family of database engines. For other uses, see dbm. dbm was the first of a family of simple database engines, originally written by Ken Thompson and released by AT T in 1979. The name is a three letter acronym for… …   Wikipedia

  • dbm — a été le premier d une famille de moteurs de base de données, à l origine écrit par Ken Thompson et publié par AT T en 1979. Son nom est l acronyme de database manager (gestionnaire de base de données). dbm stocke des données arbitraires par l… …   Wikipédia en Français

  • Berkeley DB — Original author(s) Margo Seltzer and Keith Bostic of Sleepycat Software Developer(s) Sleepycat Software, later Oracle Corporation Stable release 5.2.28 / June 10, 2011; 5 months ago …   Wikipedia

  • Gauche (Scheme implementation) — Infobox Software name = Gauche logo = caption = developer = Shiro Kawai latest release version = 0.8.13 latest release date = February 13, 2008 operating system = Cross platform genre = Programming language license = BSD License website =… …   Wikipedia

  • Comparison of mail servers — This is a comparison of mail servers: mail transfer agents, mail delivery agents, and other computer software which provide e mail services. Contents 1 Feature comparison 2 Authentication 3 Antispam Features …   Wikipedia

  • AnyDBM — is a general purpose dbm library for C++ that provides a high level templated front end to any DBM package. It is available under the GPL.Remote DBM Remote DBM (RDBM) converts a DBM using program to an RPC Client Server architecture. It was… …   Wikipedia

  • Berkeley-DB — Entwickler: Oracle Aktuelle Version: 4.7 Betriebssystem: Unix, Linux, Windows, AIX, Sun Solaris, SCO U …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”