DBM (computing)

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.[1][2][3]

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:[3]

  • 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.[4][5]
  • 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.[6][7]
  • 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.[8]
  • tdb ("Trivial Database"), a simple database used by Samba that supports multiple writers. Has a gdbm-based API.[9]
  • 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.[2][10] After a change of licensing of the Berkeley DB to GNU AGPL in 2013, projects like Debian have moved to LMDB.[11]

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;[10] the fixes would be irrelevant to open-source software users due to the licensing change locking them back on an old version.[11]

See also

References

  1. ^ Kew 2007, p. 80: "DBMs have been with us since the early days of computing, when the need for fast keyed lookups was recognized. The original DBM is a UNIX-based library and file format for fast, highly-scalable keyed access to data. It was followed (in order) by NDBM ('new DBM'), GDBM ('GNU DBM'), and the Berkeley DB. This last is by far the most advanced, and the only DBM under active development today. Nevertheless, all of the DBMs from NDBM onward provide the same core functionality used by most programs, including Apache. A minimal-implementation SDBM is also bundled with APR, and is available to applications along with the other DBMs.
    Although NDBM is now old - like the city named New Town ('Neapolis') by the Greeks in about 600BC and still called Naples today - it remains the baseline DBM. NDBM was used by early Apache modules such as the Apache 1.x versions of mod_auth_dbm and mod_rewrite. Both GDBM and Berkeley DB provide NDBM emulations, and Linux distributions ship with one or other of these emulations in place of the 'real' NDBM, which is excluded for licensing reasons. Unfortunately, the various file formats are totally incompatible, and there are subtle differences in behaviour concerning database locking. These issues led a steady stream of Linux users to report problems with DBMs in Apache 1.x."
  2. ^ a b Hazel 2001, p. 500: "The most common [single-key] format is called DBM. Most modern versions of Unix have a DBM library installed as standard, though this is not true of some older systems. The two most common DBM libraries are ndbm (standard on Solaris and IRIX) and Berkeley DB Version 2 or 3 (standard on several free operating systems). Exim supports both of these, as well as the older Berkeley DB Version 1, gdbm, and tdb."
  3. ^ a b Ladd & O'Donnell 2001, pp. 823–824: "Most UNIX systems have some kind of DBM database. DBM is a set of library routines that manages data files consisting of key and value pairs. The DBM routines control how users enter and retrieve information from the database. Although it isn't the most powerful mechanism for storing information, using DBM is a faster method of retrieving information than using a flat file. Because most UNIX sites use one of the DBM libraries, the tools you need to store your information in a DBM database are readily available.
    Almost as many flavors of the DBM libraries exist as there are UNIX systems. Although most of these libraries are compatible with each other, they all basically work the same way...
    A list follows of some of the most popular DBM libraries available:
    • DBM - DBM stores the database in two files. The first has the extension .Pag and contains the bitmap. The second, which has the extension .Dir, contains the data.
    • NDBM - NDBM is much like DBM but with a few additional features; it was written to provide better storage and retrieval methods. Also, NDBM enables you to open many databases, unlike DBM, in which you are allowed to have only one database open within your script. Like DBM, NDBM stores its information in two files using the extensions .Pag and .Dir.
    • SDBM - SDBM comes with the Perl archive, which has been ported to many platforms. Therefore, you can use DBM databases as long as a version of Perl exists for your computer. SDBM was written to match the functions provided with NDBM, so portability of code shouldn't be a problem. Perl is available on just about all popular platforms.
    • GDBM - GDBM is the GNU version of the DBM family of database routines. GDBM also enables you to cache data, reducing the time that it takes to write to the database. The database has no size limit; its size depends completely on your system's resources. GDBM database files have the extension .Db. Unlike DBM and NDBM, both of which use two files, GDBM only uses one file.
    • Berkeley db - The Berkeley db expands on the original DBM routines significantly. The Berkeley db uses hashed tables the same as the other DBM databases, but the library also can create databases based on a sorted balanced binary tree (BTREE) and store information with a record line number (RECNO). The method that you use depends completely on how you want to store and retrieve the information from a database. Berkeley db creates only one file, which has no extension."
  4. ^ "Crash Tolerance". GDBM manual. Retrieved 3 October 2021.
  5. ^ "Crashproofing the Original NoSQL Key-Value Store". Retrieved 3 October 2021.
  6. ^ yigit, ozan. "sdbm.bun". cse.yorku.ca. Retrieved 8 May 2019.
  7. ^ "Ruby SDBM library". SDBM on Github. Note that Ruby used to ship SDBM in the standard distribution up until version 2.7, after which it was made available only as an external library, similarly to the DBM and GDBM libraries, removed from the standard library in Ruby 3.1.
  8. ^ "QDBM: Quick Database Manager". fallabs.com. 2006. Archived from the original on 2020-02-27. Retrieved 2020-02-27.
  9. ^ "tdb: Main Page". tdb.samba.org.
  10. ^ a b Debroux, Lionel (16 Jun 2018). "oss-security - Fun with DBM-type databases..." openwall.com.
  11. ^ a b Surý, Ondřej (19 June 2014). "New project goal: Get rid of Berkeley DB (post jessie)". debian-devel (Mailing list). Debian.

Bibliography

Read other articles:

GodzillaPoster filmSutradaraRoland EmmerichProduserDean DevlinSkenarioDean DevlinRoland EmmerichCeritaTed ElliottTerry RossioDean DevlinRoland EmmerichBerdasarkanGodzillaoleh Toho Co., Ltd.PemeranMatthew BroderickJean RenoMaria PitilloHank AzariaPenata musikDavid ArnoldSinematograferUeli SteigerPenyuntingPeter AmundsonDavid SiegelPerusahaanproduksiCentropolis EntertainmentDistributorTriStar PicturesTanggal rilis 20 Mei 1998 (1998-05-20) Durasi139 menitNegara Amerika SerikatBah...

 

Kabinet Yamagata Pertama第1次山縣内閣Dai 1-ji yamagata naikakuKabinet Pemerintahan Jepang ke-3Perdana Menteri Yamagata AritomoDibentuk24 Desember 1889Diselesaikan6 Mei 1891Struktur pemerintahanKaisarMeijiPerdana MenteriYamagata AritomoTotal jumlah menteri13Partai anggotaOligarki Meiji  Taiseikai  Kokumin JiyutōStatus di legislatifMinoritas84 / 300Partai oposisi  Partai Liberal  Rikken KaishintōPemimpin oposisiItagaki TaisukeSejarahPemilihan umumPemilihan umum 1890P...

 

Ne doit pas être confondu avec Lychen. Pour les articles homonymes, voir Lichen (homonymie). Planche illustrative d'Ernst Haeckel (1834-1919). Les cladonies composent avec leurs thalles des « micro-paysages » variés : forêts de baobabs, podétions en forme de trompette, buissons en boules, etc. Ils ont une importance significative en Scandinavie (nourriture des rennes, emploi pour les décorations florales, les couronnes funéraires…)[1]. Les écorces offrent une d...

Об экономическом термине см. Первородный грех (экономика). ХристианствоБиблия Ветхий Завет Новый Завет Евангелие Десять заповедей Нагорная проповедь Апокрифы Бог, Троица Бог Отец Иисус Христос Святой Дух История христианства Апостолы Хронология христианства Ран�...

 

Location of El Dorado County in California This is a list of the National Register of Historic Places listings in El Dorado County, California. This is intended to be a complete list of the properties and districts on the National Register of Historic Places in El Dorado County, California, United States. Latitude and longitude coordinates are provided for many National Register properties and districts; these locations may be seen together in an online map.[1] There are 20 propertie...

 

1992 single by Peter Gabriel Not to be confused with Diggin' in the Dirt. Digging in the DirtSingle by Peter Gabrielfrom the album Us B-sideQuiet SteamReleased7 September 1992 (1992-09-07)[1]GenreArt rock[2]Length5:16LabelGeffenSongwriter(s)Peter GabrielProducer(s) Daniel Lanois Peter Gabriel Peter Gabriel singles chronology Solsbury Hill (1990) Digging in the Dirt (1992) Steam (1993) Digging in the Dirt is a song by British musician Peter Gabriel. It was releas...

Ini adalah nama Maluku, (Ambon), marganya adalah Pesulima Broery MarantikaLahirSimon Dominggus Pesulima(1942-06-25)25 Juni 1942Ambon, Masa Pendudukan JepangMeninggal7 April 2000(2000-04-07) (umur 57)Depok, Jawa Barat, IndonesiaNama lainBroeryPekerjaanpenyanyi, aktorSuami/istriAstrid Kayhatu Anita Sarawak ​(m. 1981⁠–⁠1985)​ Wanda Irene Latuperissa ​ ​(m. 1989)​Anak3Orang tuaGijsberth Pesulima Wilmintj...

 

English poet and writer (1878-1967) John MasefieldJohn Masefield in 1936Poet Laureate of the United KingdomIn office9 May 1930 – 12 May 1967MonarchsGeorge VEdward VIIIGeorge VIElizabeth IIPreceded byRobert BridgesSucceeded byCecil Day-Lewis Personal detailsBornJohn Edward Masefield(1878-06-01)1 June 1878Ledbury, Herefordshire, EnglandDied12 May 1967(1967-05-12) (aged 88)Abingdon, Oxfordshire, EnglandOccupationPoet, writerAwardsShakespeare Prize (1938) John Edward Masefield OM ...

 

Петроградская оборонаОсновной конфликт: Гражданская война в России Строительство баррикад в Петрограде во время наступления армии генерала Н.Н.Юденича Дата 13 мая — 14 ноября 1919 Место Санкт-Петербургская губерния, Олонецкая губерния Итог Победа РККА Противники РСФСР Ро�...

Cet article est une ébauche concernant une localité allemande. Vous pouvez partager vos connaissances en l’améliorant (comment ?) selon les recommandations des projets correspondants. Bad Salzdetfurth Armoiries Administration Pays Allemagne Land Basse-Saxe Arrondissement(Landkreis) Arrondissement de Hildesheim Bourgmestre(Bürgermeister) Björn Gryschka[1],[2] Partis au pouvoir indépendant Code postal 31162 Code communal(Gemeindeschlüssel) 03 2 54 005 Indicatif téléphonique 050...

 

U.S. Bank TowerLocalizzazioneStato Stati Uniti Stato federatoCalifornia LocalitàLos Angeles IndirizzoWest Fifth Street 633, Los Angeles, Californie, USA Coordinate34°03′03.64″N 118°15′15.68″W / 34.05101°N 118.254355°W34.05101; -118.254355Coordinate: 34°03′03.64″N 118°15′15.68″W / 34.05101°N 118.254355°W34.05101; -118.254355 Informazioni generaliCondizioniIn uso Costruzione1987-1990 Stilepostmoderno UsoUffici AltezzaTetto: 310.3...

 

Political party in Denmark The Alternative AlternativetAbbreviationALT Å [a]LeaderFranciska RosenkildeFoundersUffe ElbækJosephine FockFounded27 November 2013Split fromDanish Social Liberal PartyYouth wingAlternativets UngeMembership (2022) 1,331[1]IdeologyGreen politics[2]Political positionCentre-left[3] to left-wing[4]European affiliationDiEM25[5]European Spring[6]Nordic affiliationNordic Green Left AllianceColours ...

Title in the Peerage of England This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Baron le Despencer – news · newspapers · books · scholar · JSTOR (December 2018) (Learn how and when to remove this message) Barony of le DespencerArms of Despencer, Barons le Despencer: Quarterly 1st & 4th: Argent; 2nd &...

 

坐标:43°11′38″N 71°34′21″W / 43.1938516°N 71.5723953°W / 43.1938516; -71.5723953 此條目需要补充更多来源。 (2017年5月21日)请协助補充多方面可靠来源以改善这篇条目,无法查证的内容可能會因為异议提出而被移除。致使用者:请搜索一下条目的标题(来源搜索:新罕布什尔州 — 网页、新闻、书籍、学术、图像),以检查网络上是否存在该主题的更多可靠来源...

 

Сельское поселение России (МО 2-го уровня)Новотитаровское сельское поселение Флаг[d] Герб 45°14′09″ с. ш. 38°58′16″ в. д.HGЯO Страна  Россия Субъект РФ Краснодарский край Район Динской Включает 4 населённых пункта Адм. центр Новотитаровская Глава сельского пос�...

此条目序言章节没有充分总结全文内容要点。 (2019年3月21日)请考虑扩充序言,清晰概述条目所有重點。请在条目的讨论页讨论此问题。 哈萨克斯坦總統哈薩克總統旗現任Қасым-Жомарт Кемелұлы Тоқаев卡瑟姆若马尔特·托卡耶夫自2019年3月20日在任任期7年首任努尔苏丹·纳扎尔巴耶夫设立1990年4月24日(哈薩克蘇維埃社會主義共和國總統) 哈萨克斯坦 哈萨克斯坦政府...

 

العلاقات السعودية الكورية الجنوبية   السعودية   كوريا الجنوبية السفارات سفارة السعودية في كوريا الجنوبية   السفير : سامي بن محمد السدحان   العنوان : سيول، كوريا الجنوبية سفارة كوريا الجنوبية في السعودية   السفير : بارك جوون يونغ   العن...

 

بدرجيخ سميتنا (بالتشيكية: Bedřich Smetana)‏    معلومات شخصية الميلاد 2 مارس 1824 [1][2][3][4][5][6]  الوفاة 12 مايو 1884 (60 سنة) [1][2][3][4][6][7]  براغ[8][6]  مواطنة الإمبراطورية النمساوية الإمبراطورية النمساوية المجرية  عدد ال...

Commune and town in Oum El Bouaghi Province, AlgeriaAïn M'lilaCommune and townAïn M'lilaLocation in AlgeriaCoordinates: 36°02′10″N 6°34′15″E / 36.03611°N 6.57083°E / 36.03611; 6.57083Country AlgeriaProvinceOum El Bouaghi ProvincePopulation (Census 2008) • Total88,441Time zoneUTC+1 (CET) Aïn M'lila (Arabic: عين مليلة, Ayn Malīlah; which means the white source, the root m-l-l being of Berber origin) is a town and commune in O...

 

الإمام  ابن خلكان معلومات شخصية اسم الولادة أحمد بن محمد بن إبراهیم بن أبي بکر بن خلکان الشافعي الميلاد 22 سبتمبر 1211   أربيل  الوفاة 30 أكتوبر 1282 (71 سنة)   دمشق  الديانة مسلم سني الحياة العملية المهنة مُحَدِّث،  وكاتب،  وقاضي شرعي،  ومؤرخ،  وأديب،  ومدر...