Build a P2P Document Oriented Database

Benoit Chesneau
Web craftsman @ Enki Multimedia

Barrel ( is a modern document-oriented database in Erlang focusing on data locality (put/match the data next to you) and P2P with an effort to maintain a compatibility with the Apache CouchDB API.

Barrel started as a fork of Apache CouchDB, another database in Erlang, but it quickly appeared that we needed to go further. Building a database in Erlang is indeed challenging. I/Os are handled differently from the other VM for example. Performance is always a trade-off versus the concurrency and the fault tolerance. On the other hand, Erlang, its vm, the OTP framework offer many competitive advantages that can help you to build a very effective database. So Barrel has then been rewritten to benefit from them.

Talk objectives:

This talk will first deconstruct a database and then focus how we can build one in Erlang using Barrel as an example. We will see which part probably needs to be in C, which one really fit well in Erlang… It will show you also how building a P2P protocol in Erlang is easy and help us to make barrel a true P2P database.

Target audience:

Anyone interested in the development of databases and P2P.


Benoît Chesneau is a internet craftsman, living near Paris. He has years of experience in building small and big-scale database backend websites. He is the founder of a company building innovative web services and open-source applications. Benoît Chesneau is also the founder of the Barrel projects, the author of Gunicorn and multiple other opensource projects in Python and Erlang.

GitHub: benoitc

Twitter: @benoitc

Back to conference page