# \[ANN\] Reviving LMDB.jl

**URL:** <https://discourse.julialang.org/t/ann-reviving-lmdb-jl/73061>\
**Category:** Package Announcements\
**Created:** [December 14, 2021, 7:36am UTC](https://discourse.julialang.org/t/ann-reviving-lmdb-jl/73061 "2021-12-14T07:36:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabiangans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fabiangans/32/2624_2.png) [@fabiangans](https://discourse.julialang.org/u/fabiangans)\
**Post date:** [December 14, 2021, 7:36am UTC](https://discourse.julialang.org/t/ann-reviving-lmdb-jl/73061/1 "2021-12-14T07:36:41Z")

</div>

I want to announce that LMDB.jl, a wrapper for the [LMDB C library](http://www.lmdb.tech/doc/index.html), was added to the General registry again. The package existed before in pre-1.0 times, and was now brought up to date using new wrapper generators, the Artifact system etc.

LMDB provides a simple persistent key-value store, which uses memory-maps, supports all types of parallelism and is quite performant.

In the newly tagged version I also added a dictionary-like interface to LMDB.jl which should make it very simple to use the library. Here is an MWE to create and use a database at path `"./mydb"`:

```julia
julia> d = LMDBDict{String, Vector{Float64}}("./mydb")
julia> d["aa"] = [1.0, 2.0, 3.0]
julia> d["ab"] = 1.0:2.0:10.0
julia> d["bb"] = [-1, -2, -3, -4]

julia> d["ab"]
5-element reinterpret(Float64, ::Vector{UInt8}):
 1.0
 3.0
 5.0
 7.0
 9.0

```

Retrieve all entries:

```julia
julia> collect(d)
3-element Vector{Pair{String, Vector{Float64}}}:
"aa" => [1.0, 2.0, 3.0]
"ab" => [1.0, 3.0, 5.0, 7.0, 9.0]
"bb" => [-1.0, -2.0, -3.0, -4.0]

```

Search for keys with a certain prefix:

```julia
julia> keys(d,prefix="a")
2-element Vector{String}:
 "aa"
 "ab"

```

> **[GitHub - wildart/LMDB.jl: Julia interface to Lightning Memory-Mapped Database...](https://github.com/wildart/LMDB.jl)**
>
> Julia interface to Lightning Memory-Mapped Database (LMDB) - GitHub - wildart/LMDB.jl: Julia interface to Lightning Memory-Mapped Database (LMDB)
