I'm happy to announce the immediate availability of my thesis! It was handed in in July 2010 as my diplom thesis in the academic program of Media Informatics at Beuth Hochschule für Technik Berlin (University of Applied Sciences). A German Diplom is comparable to a combined bachelor's and master's degree. Originally it has been written in German, so I'm very happy it's also available for English speaking readers now: thanks a lot to the awesome Sander Van de Moortel for translating it into English, and to CouchOne for sponsoring the translation. Read also my thank you notes for more gratefulness.
I hope the thesis is an interesting read and useful for your research or development!
If you have a couchapp and want to have nice URLS, go read this blogpost. If you still don't get it, here is how to do it. It doesn't work with my outliner app, because it is so entangled with old couchapp and jquery.couch.js versions and I'm not up to upgrade hell right now. But I'll write it down for my next project and for you, yay.
Let's say you have an app running at http://account.couchone.com/mydb/_design/doingnotes/index.html and want to add the additional URL http://account.couchone.com/index.html. First you have to set up a virtual host. (Want to know why? Go back read the blogpost). If you are using a hosted CouchDB instance and don't have access to the local.ini file, you can also do this remotely:
I'm done!! Three weeks ago I handed in my diplom thesis. The practical part was the design and implementation of a distributed, replicatable outliner with the NoSQL database CouchDB. As theoretical work I evaluated Distributed Systems, CouchDB, various web technologies and programming strategies. I still have to pass the oral exam, but my degree is finally very close - soon I can call myself a graduated computer scientist. Yay!
As soon as academic procedures allow it, I'll publish the text and the source code of the thesis here. Until then I'd like to say thank you to a few people. As the foreword of thesis won't get as much attention as this blog, I'll do it here.
I recently wrote a testsuite for CouchDB's Javascript HTTP API. Among the things I tested were the security methods. That's those that deal with authentication - like signup, login, logout and so on. The challenge was to make sure my tests wouldn't interfere with the CouchDB setup of the person running the tests.
Background
CouchDB stores the information about the database users in a special database, the authentication_db. The default authentication_db is called "_users". So this is where your user data is saved when you sign up without taking care about the details, e.g. when you use the signup method provided by the JQuery HTTP API. Read more about the ways to interact with the authentication_db in the HTTP API documentation (JQuery methods), and read more about general CouchDB security in the CouchDB Wiki or in The Definitive Guide.
How to set the authentication_db
When you e.g. create database users from within your tests, how can you make sure they don't mess up the actual authentication_db, the one the unsuspecting user might use in production?
CouchDB is a database that I quite like. In fact, I haven't done much else this winter, as the programming part of my thesis involved diving into many of CouchDB's features. I had just finished my little program and was desperately looking for an excuse not to start writing the thesis. Mercifully Jan from Couchio came along and asked if I wouldn't like to write a testsuite for CouchDB's Javascript HTTP API, and the documentation with it. I wanted!
What is this HTTP API?
If you have worked with CouchDB from a Javascript program before (eg Sammy.js is a good companion for a simple web application), you have probably used the methods a file named couch.js provides. With this interface you can easily access the most common CouchDB functionality without having to handle the XMLHttpRequest yourself. It allows you to create a "database object" and then perform things on this object, for example save or delete documents:
For the couchapp I'm writing, I recently wanted to do a bulk delete operation with CouchDB, but found very little about it on the web. I don't know if my approach is the best way to go, but well, it works - if you know a better way, I'm happy to learn about it.
In CouchDB, there are a couple of convenience methods in jquery.couch.js to help you dealing with the database, documents and views. There is a method for deletion too (removeDoc), but it only can handle one document at a time. In the style of bulkSave, I added a bulkRemove method:
Do you know what's behind these buzzwords: CouchDB / Couchapp / Sammy.js? Not really? Then please look at this article now: Sammy.js, CouchDB, and the new web architecture. The title says it all.
This setup happens to be the field of my diploma thesis, friendly sponsored and supported by Upstream. During the next months I'll develop a super duper thing with these technologies, and then I'll write 80 scientific pages about it. Yees, I'm not that much looking forward to the second part! Until then, I'm planning to semi-regularly blog about my findings.
I'm not allowed to share the code before I have the diploma in my hands. But, because my workmate Frank Proessdorf is so jealous of what I do, he and I started working on an app with a similar setup on our Upstream Research Fridays, to try things out. Here it is. Don't expect anything yet.
Today I'm going to tell you about some details of my testing setup.