ArticleslgStudy

computer science

DBM (computing)

DBM (computing) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand DBM (computing) rather than just read about it. In short: In computing, a DBM is a library and file format providing fast, single-keyed access to data. A key–value database from the original Unix, dbm is an early example of a NoSQL system.

Key takeaways

  • DBM (computing) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect DBM (computing) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of DBM (computing) from memory before moving on to harder problems.

Reference excerpt

In computing, a DBM is a library and file format providing fast, single-keyed access to data. A key–value database from the original Unix, dbm is an early example of a NoSQL system.

History The original dbm library and file format was a simple database engine, originally written by Ken Thompson and released by AT&T in 1979. The name is a three-letter acronym for DataBase Manager and can also refer to the family of database engines with APIs and features derived from the original dbm. The dbm library stores arbitrary data by use of a single key (a primary key) in fixed-size buckets and uses hashing techniques to enable fast retrieval of the data by key. The hashing scheme used is a form of extendible hashing, so that the hashing scheme expands as new buckets are added to the database, meaning that, when nearly empty, the database starts with one bucket, which is then split when it becomes full. The two resulting child buckets will themselves split when they become full, so the database grows as keys are added. The dbm library and its derivatives are pre-relational databases – they manage associative arrays, implemented as on-disk hash tables. In practice, they can offer a more practical solution for high-speed storage accessed by key, as they do not require the overhead of connecting and preparing queries. This is balanced by the fact that they can generally only be opened for writing by a single process at a time. An agent daemon can handle requests from multiple processes but introduces IPC overhead.

Implementations The original AT&T dbm library has been replaced by its many successor implementations. Notable examples include:

ndbm ("new dbm"), based on the original dbm with some new features. GDBM ("GNU dbm"), GNU rewrite of the library implementing ndbm features and its own interface. Also provides new features like crash tolerance for guaranteeing data consistency. sdbm ("small dbm"), a public domain rewrite of dbm. It is a part of the standard distribution for Perl and is available as an external library for Ruby. QDBM ("Quick Database Manager"), a higher-performance dbm employing many of the same techniques as Tokyo/Kyoto Cabinet. Written by the same author before they moved on to the cabinets. tdb ("Trivial Database"), a simple database used by Samba that supports multiple writers. Has a gdbm-based API. Berkeley DB, 1991 replacement of ndbm by Sleepycat Software (now Oracle) created to get around the AT&T Unix copyright on BSD. It features many extensions like parallelism, transactional control, hashing, and B-tree storage. LMDB: copy-on-write memory-mapped B+ tree implementation in C with a Berkeley-style API. The following databases are dbm-inspired, but they do not directly provide a dbm interface, even though it would be trivial to wrap one:

cdb ("constant database"), database by Daniel J. Bernstein, database files can only be created and read, but never be modified Tkrzw, an Apache 2.0 licensed successor to Kyoto Cabinet and Tokyo Cabinet WiredTiger: database with traditional row-oriented and column-oriented storage.

Availability As of 2001, the ndbm implementation of DBM was standard on Solaris and IRIX, whereas gdbm is ubiquitous on Linux. The Berkeley DB implementations were standard on some free operating systems. After a change of licensing of the Berkeley DB to GNU AGPL in 2013, projects like Debian have moved to LMDB.

Reliability A 2018 AFL fuzzing test against many DBM-family databases exposed many problems in implementations when it comes to corrupt or invalid database files. Only freecdb by Daniel J. Bernstein showed no crashes. The authors of gdbm, tdb, and lmdb were prompt to respond. Berkeley DB fell behind due to the sheer amount of other issues; the fixes would be irrelevant to open-source software users due to the licensing change locking them back on an old version.

See also Ordered key–value store Embedded database Flat-file database ISAM Key–value database Mobile database NoSQL Semaphore (programming)

References

Bibliography

SDBM library @Apache Matthew, Neil; Stones, Richard (2008). "Databases". Beginning Linux Programming. Wiley. Olson, Michael A.; Bostic, Keith; Seltzer, Margo (1999). "Berkeley DB" (PDF). Proceedings of the FREENIX Track:1999 USENIX Annual Technical Conference.

Worked examples

Example 1 — a first encounter with DBM (computing)

Start with the simplest possible case. Write down what DBM (computing) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to DBM (computing) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about DBM (computing) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of DBM (computing)

In research
DBM (computing) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses DBM (computing) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
DBM (computing) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Database engines, Embedded databases, Free database management systems, so understanding it makes those chapters shorter.
In everyday life
Look for DBM (computing) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “DBM (computing)” →

How to study DBM (computing) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what DBM (computing) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain DBM (computing) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is DBM (computing) in simple terms?

In computing, a DBM is a library and file format providing fast, single-keyed access to data. A key–value database from the original Unix, dbm is an early example of a NoSQL system.

Why does DBM (computing) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study DBM (computing)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on DBM (computing).

Tags

  • Database engines
  • Embedded databases
  • Free database management systems
  • Structured storage

Keep exploring