ANN: ForestDB

158 views
Skip to first unread message

Jens Alfke

unread,
Oct 2, 2014, 4:55:50 PM10/2/14
to mobile-c...@googlegroups.com
The next-generation ForestDB storage engine that I've mentioned here a few times is now available in beta form, as announced today on Couchbase's blog. Its Github repository has the source code and some documentation including a good overview.

ForestDB is a fast and space-efficient key-value storage engine that can be used as an embedded storage layer for applications running on high-end servers or mobile devices. Its main index structure is built from Hierarchical B+-Tree based Trie, or HB+-Trie, to address the main drawbacks of typical B+-Tree index structure that has been widely used in traditional database systems. … From our benchmark results, we observed that ForestDB especially shows much better I/O performance on Solid-State Drives (SSDs) and flash memory.

I've been working with ForestDB since March, integrating it into Couchbase Lite to replace SQLite. This wiki page describes the project at a high level. It's still a work in progress (as is ForestDB itself), but I've seen speedups from 2x to 5x in common tasks (measured on an iPhone 5) — see the chart below.

You can try it out for yourself, if you like. The instructions are here. At a high level, you just need to check out the "forestdb" branch of couchbxse-lite-ios and build it. Everything should work the same, just faster, with a few exceptions.

(By the way, if you're interested in using ForestDB directly you might be interested in the C++ wrapper library I wrote around it. It adds an OO API, indexes, and structured keys. It's theoretically cross-platform, though at the moment I think it still has a few minor Mac/iOS-specific bits.)

I'm really excited that ForestDB is finally public. I've been enjoying using it and it's great to finally be able to share the project with you. We don't yet have a firm release date for Couchbase Lite-with-ForestDB, but we're planning to release it at the same time that ForestDB itself goes 1.0.

—Jens

Cristian A Moterroza

unread,
Oct 2, 2014, 5:06:45 PM10/2/14
to mobile-c...@googlegroups.com
Jens,

I think I’m speaking for everybody on the list: this is awesome! Great work!

-- 
Cristian A Monterroza
--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/48AE1051-BEFD-4DB7-9D4A-39404684AF12%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.
20EF20F8-FECA-4BF5-9133-7F79B1A6526C@hq.northscale.net

Cristian Monterroza

unread,
Oct 2, 2014, 6:47:16 PM10/2/14
to mobile-c...@googlegroups.com
Jens, 

Is the couchbaselabs/forestdb repo public? I’m getting an error when I try to initialize the ForestDB submodule. 

$ git checkout forestdb
D vendor/CBForest
Already on 'forestdb'
Your branch is up-to-date with 'origin/forestdb'.
$ git submodule update --init --recursive
Cloning into 'vendor/CBForest'...
remote: Repository not found.
Clone of 'https://github.com/couchbaselabs/cbforest.git' into submodule path 'vendor/CBForest' failed

Cristian A. Monterroza
(718) 877-9948


<PastedGraphic-2.png>

Jens Alfke

unread,
Oct 2, 2014, 6:53:21 PM10/2/14
to mobile-c...@googlegroups.com

On Oct 2, 2014, at 3:47 PM, Cristian Monterroza <cmont...@wrkstrm.me> wrote:

Is the couchbaselabs/forestdb repo public? I’m getting an error when I try to initialize the ForestDB submodule. 

Oops, it's couchbaselabs/cbforest that isn't public. Let me fix that.

…ok, you should be able to clone now.

—Jens

Todd Freese

unread,
Oct 2, 2014, 7:07:03 PM10/2/14
to mobile-c...@googlegroups.com
Very cool!

Is there any documentation on how an existing app would handle an upgrade to forestDB on iOS?

Todd

Jens Alfke

unread,
Oct 2, 2014, 7:12:31 PM10/2/14
to mobile-c...@googlegroups.com

On Oct 2, 2014, at 4:07 PM, Todd Freese <to...@filmworkers.com> wrote:

Is there any documentation on how an existing app would handle an upgrade to forestDB on iOS?

Yes, in the instructions. :)

—Jens

Todd Freese

unread,
Oct 3, 2014, 12:33:09 PM10/3/14
to mobile-c...@googlegroups.com
D'oh! Sorry about that. 

t

dyowee

unread,
Oct 3, 2014, 5:14:42 PM10/3/14
to mobile-c...@googlegroups.com
Awesome! Will it have encryption?

Jens Alfke

unread,
Oct 4, 2014, 1:56:01 PM10/4/14
to mobile-c...@googlegroups.com

On Oct 3, 2014, at 2:14 PM, dyowee <csharpen...@gmail.com> wrote:

Awesome! Will it have encryption?

I think they plan to add encryption support, but unlike SQLite there isn't an existing encryption plug-in.

—Jens
Reply all
Reply to author
Forward
0 new messages