iWantMyName - using Erlang and CouchDB behind the scenes
Tuesday, December 9th, 2008The creation of our domain registrar site iWantMyName was certainly the most exciting project I did so far. This is mostly because of an early decision to use the latest stuff you can get out there on the technology scene at the moment. We use Erlang with mochiweb for the iPhone interface, CouchDB for database storage where applicable and lots of nice things like nginx as frontend load balancer and so on. The only traditional thing in the game is Perl which obviously powers the backend.
So what is this all about? Erlang is a telco language that gained traction in the web world since many of us realized that scalability is the problem we continually run into. Erlang is not a panacea, but it is a functional language that makes concurrent programming really easy. We only use Erlang at the moment for the iPhone API to dispatch requests to our domain engine but what we experienced in performance and from the ease of development, we will definitely write more parts in Erlang in the future.
CouchDB is the next big thing in the database world when it comes to web related development. It is a schema-less database loosely modeled after the Lotus Notes principles. CouchDB is written in Erlang (yes I love Erlang) and gives you a map/reduce database with powerful replication features and no painful configuration odysseys. We use CouchDB for caching, logging and for various user settings. The nicest DB we have in CouchDB is the TLD database though, check it out in action on our price list.
The platform itself is a Catalyst application using the power of Perl with the MVC pattern that seems to fit the development of web based applications so nicely. The platform talks to PostgreSQL and CouchDB depending on the functionality needed. As we went along, more and more features went into CouchDB though and with further development we will use it even more. Catalyst enabled us to push the whole platform out on the market in only three months time and I have no regrets having chosen Catalyst over the many other options out there.
The backend is Perl and PostgreSQL. The domain business is traditionally Perl and in fact lots of the registries and registrars we work with run on Perl as well. It just seems to be native to this kind of business. The Perl environment is written as a set of daemons interacting with each other. There is no old school cron driven bit of code here. It is entirely event driven. Even though the Perl code is performing well we intend to rewrite big parts of this infrastructure in Erlang in the future.
Now that we have a bit more time again, we will start to review our code base and write some more articles about CouchDB and Erlang. And we will release those bits of code that are general enough to help others understand the principles we used. Watch this space for announcements.
