[erlang-questions] B-trees

Walter Weinmann <>
Thu Dec 8 07:36:16 CET 2016

As a pure internal data structure you would prefer binary trees - I did
include similar tests with the gb-trees module in my performance analysis.
gb_trees is much faster. The advantage of the b_trees module comes in
connection with the storage of large data blocks on external memory.

I had a quick look on emdb (https://github.com/alepharchives/emdb) which is
the Erlang wrapper of LMDB. I couldn't see a traversal operation. So it
seems to be difficult to do range scans.

The main advantages of the b_trees module (https://github.com/walter-
weinmann/b_trees) are:

   - pure Erlang implementation,
   - very similar API to the gb_trees module,
   - implementation of standard algorithms (see Cormen, Introduction to
   Algorithms, Chapter 18 B-Trees)
   - key sort is pluggable
   - data storage is pluggable

So I suppose the b_trees module would only be applied in connection with
external memory.

On 8 December 2016 at 03:20, Richard A. O'Keefe <> wrote:

> What are the advantages of B-trees as an internal data structure?
> Would it be possible to layer something like this on top of lmdb?
> _______________________________________________
> erlang-questions mailing list
> http://erlang.org/mailman/listinfo/erlang-questions


*Walter Weinmann*
Obertorplatz 4
CH-4130 Rheinfelden
Tel +41 (0)61 841 06 10
Schulstrasse 1
CH-6037 Root
Tel +41 (0)41 530 39 70
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161208/92fb1c12/attachment.html>

More information about the erlang-questions mailing list