Erlang and CouchDb
My work on Fabric is now done, in that I'm now doing just-in-time feature development. That's not to say Fabric is feature complete, but its close enough to be usable, all the core language features and syntax is implemented and it has a good start on a test suite. From this point on, all features will be added as needed.
So now I've started re-writing CouchDb in the concurrent functional language Erlang. Originally I was planning on wrapping my C++ code with an Erlang server, but I've decided to rewrite as much as possible of the old code in Erlang. Now this may seem like I'm abandoning many months of work, but the truth is it was helpful for me to work out the design of the disk storage structures CouchDb in a language I was very familiar with, then re-implement in Erlang. Most of the actual work wasn't coding but design and research, and that time isn't wasted. Also, it would have been overwhelming to design the architecture at the same time trying to get my head around Erlang, I'm not sure that would have been a productive way to about it.
Now after about a week of serious work with Erlang, I'm convinced I made the right decision. Erlang has been much easier to learn than I thought it would be (way easier than Antlr IMO), and already I'm more productive with it than I've been in C++, plus networking, concurrency and fault-tolerance are built in to the language core, its not just some add-on library. This has much to do with Erlang being specifically designed for use in telecomm server applications, and I think makes it particularly well suited for a database engine and server. My plan has always been to make CouchDb massively scalable with node partitioning, Erlang will make that easy.
So, in case you can't tell, I'm very excited about Erlang at this point. It provides me with a much better level of abstraction for this work, much of the drudgery I was experiencing in C++ is now gone. If my high productivity in Erlang keeps up, in a few more weeks I should have matched all my existing C++ functionality, but now with a robust, concurrent server architecture. Yowza!
Posted February 9, 2006 2:09 PM

Comments
*sigh*, so many languages, so little time. How about some sample code so us Erlang curious can have a peek.
Pete Lyons, February 9, 2006 4:58 PM
"robust, concurrent server" Damien rules!
David, February 9, 2006 6:29 PM
Ned also asked for a sample, and I meant to produce one. But everytime I start to clean up the code I end up continuing development and in turn the new code is almost always in a quasi-working state. Clearly I can't release that.
My coding is continuing at furious pace, but so is my learning, so right now most of what I'm producing is going to get edited several times before I'm through.
I rule? Thanks David!
Damien, February 11, 2006 8:46 PM
Damien, these are probably old news for you but I found them very informative when I was investigating the "concurrncy is the future meme" recently:
http://www.devmaster.net/articles/mmo-scalable-server/
http://www.erlang.org/ml-archive/erlang-questions/200601/msg00003.html
Dan Sickles, February 13, 2006 2:10 AM
Wow. You think you've heard it all. What the hell is going on? Are you independently wealthy? Are you really this dedicated?
Very impressive that you have taken your vision this far.
Matt, February 14, 2006 11:36 PM
"Are you independently wealthy? Are you really this dedicated?"
I'm not wealthy, not even close. Dedicated? I suppose I am. But then easy to be dedicated when you really enjoy your work. It's like its not really work at all.
Damien, February 15, 2006 11:34 AM
Post a comment