Project Description

DataTanker is an embedded persistent key-value store for .NET.
Pure C# code, all B+Tree features, MIT License.


The start of this project was caused by my interest in the field of disk-based structures like B-Trees.


  • simple and lightweight
  • fast enough
  • variable length values
  • concurrent access
  • atomic operations
  • user-defined serialization routines


I did not perform detailed comparison with competitors. The benchmarks provided by competing developers are usually biased and misleading.
However, I provide some performance values. To ensure reliability you can run the Performance.exe test util.
  • sequential insert and read 1 000 000 integer keys with 20-byte values - 16sec
  • insert 100 000 integer keys with large values (from 200 to 5000 bytes) - 12sec
  • perform 1 000 000 random operations on 100 000 key set - 8sec


-other access methods (trie, hash table etc.)
-enhancement of fault tolerance via WAL or another technique
-ACID, MVCC, transactions as unit-of-work


Any feedback is welcome. Feel free to ask a question, send a bug report or feature request.


Insert and read million records:
        static void Main(string[] args)
            var factory = new StorageFactory();

            // create storage with integer keys and byte[] values
            using (var storage = factory.CreateByteArrayStorage<int>(
                BitConverter.GetBytes,            // key serialization
                p => BitConverter.ToInt32(p, 0),  // key deserialization

                var r = new Random();
                var bytes = new byte[20];
                const int count = 1000000;

                for (int i = 0; i < count; i++)
                    // fill value with random bytes

                    // insert
                    storage.Set(i, bytes);

                for (int i = 0; i < count; i++)
                    // read
                    bytes = storage.Get(i);

Last edited Mar 27, 2014 at 9:25 AM by victor_scherbakov, version 31