It lives

alive.jpg

Today I finally got the complete CouchDb server working.

There is still much work to do before a public beta (biggest items: Fabric isn't hooked in, REST API, UTF8 collation support), but the hardest stuff is all there and working.

I had already gotten the database code working for a while now, but last week when I was trying to complete the entire concurrent server architecture I realized I had made a bad design decision earlier. I was really stressed for a few days as I puzzled over my design and the flaw, worried I was going to have to make serious structural changes to the code. After much tortured thinking, I finally wrapped my head around it all and found the solution, which turned out not to be such a big change after all.

So today I created some basic tests to put the database server through its paces, running a lots of test client processes concurrently. Each test client reads and writes documents and creates computed tables.

The first time I ran the tests I saw tons of error messages about update conflicts. Odd, that error means there already existed in the database a document with that same id. Since each document was new, maybe there was some sort of corruption bug?

It didn't take much debugging before I realized they were indeed real update conflicts. It turns out the random number generator in Erlang is seeded per process, meaning the "random" UUIDs generated by each test process were getting randomly generated exactly the same way each time.

So the first process was succeeding with its updates and all the rest, trying to create the same documents, were getting update conflicts. And the database correctly identified them as such (even though I hadn't actually tested out that code yet, cool).

So I fixed the UUID generator and reran the tests. Then it all just worked.

It's alive.

Posted June 5, 2006 7:18 PM

Comments

Excellent. I'm excited to hear this. Can't wait to get my hands on the beta to play around with it. I honestly don't have anything specific planned for it, but I'll be playing around with it anyhow!

M.T.

Matt Todd, June 5, 2006 11:10 PM

Splendid effort! It's been really interesting following the story of Couch so far. Please keep telling all :o)

Ben Poole, June 6, 2006 4:16 AM

Hi Damien, I've been reading your posts for many months about CouchDB and I did not think it was a real product. Congratulations !

Lionel, June 6, 2006 8:05 AM

Gratz! Nice to see your hardwork paying off! I too can't wait to get my grubby hands on it to see it action.

Bill Engels, June 6, 2006 8:52 AM

Congrats!!!! How do I invest :-D

Carl, June 6, 2006 10:54 AM

Thanks everyone.

I did not think it was a real product

Lionel, sometimes I thought that too ;)

Carl, that is actually a good question. I'm not looking for investments, but once I publicly release the first beta, I'm going to start actively looking at the business side of things.

Eventually I'll probably need to find an investor, business partner or existing software company to work with, but I currently have nothing but vague ideas and notions about it all. I definitely don't have a business plan worked up yet.

But I'd love to hear some suggestions.

And of course, if anyone has a big wad of cash burning a hole in their pocket, don't hesitate for a second to contact me ;)

Damien, June 6, 2006 2:01 PM

Did they let you work on it in the Aardvark Building at the Google-Charlotte office?

Ronnie, June 6, 2006 5:51 PM

Kudos on the milestone, it's been interesting following CouchDb's development. Your blog articles about it were one factor that got me into Erlang programming. Looking forward to trying out the first beta.

Arto Bendiken, June 7, 2006 11:57 AM

Party time!

Thomas Gumz, June 7, 2006 8:05 PM

Congrats man - really looking forward to this!

Chris Toohey, June 7, 2006 8:33 PM

Woohoo! Congratulations... I know you've got some way to go, but it must have felt so good to get this far!

I hope the rest of the job is quick and easy. :-)

Philip Storry, June 12, 2006 5:01 PM