Posts Tagged ‘couchdb’

Speaking at Scotland on Rails

Wednesday, January 7th, 2009 by Alexander Lang

Scotland on Rails will take place On March 26-28 2009 in Edinburgh. The organizers have just published the list of speakers. Pretty nice lineup including Jim Weirich, Yehuda Katz, Pat Maddox, Chad Fowler and more. And the best thing: I will be speaking about using CouchDB with Ruby/Rails, starring live coding and couch potato - my own little persistence layer for CouchDB.


DevHouseBerlin FTW!

Wednesday, December 10th, 2008 by Thilo Utke

The DevHouseBerlin weekend is over, but don’t worry if you missed this one. This first one was such a success that we will do more of them.

Thanks to all of those who came, helped, organized and shared their knowledge to make this such fun. I’m not lying when saying that everything turned out to be better than expected.

The upfront organization was minimal. Special thanks to Jan and Alex! We even got some unexpected PR beforehand thanks to an online article about the DevHouse. In response we bumped up the available slots to 20. Which were all filled up soon.

The location Box 119 which houses the offices of upstream, finnlabs and rocket rentals was an ideal location for such an event with its medium large office rooms and a bigger foyer. Box 119 had a solid infrastructure, the WiFi and Internet didn’t let us down once. We even had a decent coffee machine, major factor!

Saturday was packed. I guessed more than 30 people at once filled the DevHouse. Everybody was very open and eager to share. The presentation slots for the evening were filled up already by the early afternoon. I even lost my planned slot because of getting out of bed a bit later than planned.

Right from the beginning major hacking was going on. In the afternoon the talks started. In parallel there was tons of time to chat, eat and hack at will within a very relaxing atmosphere.

PHP raised in my opinion again, after I learned through Falko’s Meta Programming PHP talk that it also has a method_missing equivalent. Nico gave some helpful user experience insights by analyzing start pages on the projector. It’s amazing how many - in retrospective obvious things - you can do wrong on your start page. With Fabian we had a non technical discussion about Economy, after his talk about Fixing Money, which unfortunately left out the solution. After that talk I heard some creepy stories from The Enterprise at dinner.

At 2am at least a dozen people were still in the house. I left at 3:30am still full awake thanks to the optimal Club Mate supply.

Sunday wasn’t that busy. People dropped in later, I had plenty of time to get a presentation slot this time. ;) Some realtime programming battle was going on in the afternoon. You can find Gregor’s battle tank A.I. on Github. Filip showed some quick code kung fu by building a poll app with Django in his talk. This little python Framework is worth a look, if you need to get up small apps fast.
My first talk on Bug Fighting with TDD went well. People seemed to be very interested in the subject. I had some time to play with JRuby and was able to get HtmlUnit to run with Webrat, although my solution is still sort of hackish.

CouchDB was all over the place of course with Jan around. He helped interested folks to get it up an running and helped out with problems related to CouchDB. Alex used the time to enhance his CouchDB persistence layer couch_potato. It will make the transition for rails people much easier.

People who stayed late this sunday - which excludes me - witnessed as the very first the rise of cloudplayer the most beautiful online music player in the world wide interweb, that Erik & Henrik gave the last touches at the DevHouse.

These where just some of the talks, projects and peoples that I get to know that weekend. There was so much more as you can see from the photos and the wiki.

Wow, it was just great. And next time will be even better. We will tell you more soon on this ;)

Couch Potato unleashed - a couchdb persistence layer in ruby (updated)

Monday, October 27th, 2008 by Alexander Lang

Update: the gem is now available, see the installation instructions below.

After several weeks of incubating on my computer it’s finally time to get real: I have just open sourced Couch Potato under the MIT license. You can get Couch Potato on github now. For an introduction to CouchDB and ruby please read my previous blog post A CouchDB primer for an ActiveRecord mindset. The following is a very short introduction into using Couch Potato. If you want to know more you can start with the README.

The goal of Couch Potato is to create a migration path for users of ActiveRecord and other object relational mappers to port their applications to CouchDB. It therefore offers a basic set of the functionality provided by most ORMs and adds functionality unique to CouchDB on top.

Installation

Couch Potato is available as a gem from http://gems.github.com, so you can just do

Alternatively you can download the sources from github. If you are using rails just copy the files into vendor/plugins, create a RAILS_ROOT/config/couchdb.yml file (see the README for the format) and you are ready to go. For other applications you will have to require the lib/couch_potato.rb file and then set the database name by calling CouchPotato::Config.database_name = 'name of the db'.

As Couch Potato is still very young you can expect its feature set to grow quite a bit in the near future. What you can download now is the very core together with a few features giving you a glimpse of what is about to come:

Persistence

Create a new class and make its instances persistable by including the Persistence module. As there is no schema in a CouchDB you have to declare the properties you want to persist:

Now you can save your objects:

Properties:

You can of course also retrieve your instance:

Associations

As of now has_many and belongs_to are supported. By default the associated objects are stored in separate documents linked via foreign keys just like in relational databases.

When saving an object all associated objects are automatically saved as well. All these save operations are sent to CouchDB in one operation which means the whole process is atomic across all objects saved, plus only one database roundtrip is required making it much faster.

As CouchDB can not only store flat structures you also store associations inline:

This will store the addresses of the user as an array within your CouchDB document.

(more…)

A CouchDB primer for an ActiveRecord mindset

Thursday, September 25th, 2008 by Alexander Lang
picture from http://uk.gizmodo.com/2006/07/27/kick_back_on_the_cabernet_couc.html

That couch was our intro picture at the workshop.
(picture from gizmodo.com)

Monday was the first event at our new upstream office, starring @janl and me presenting an introduction to CouchDB - including a new hands on examples part - and afterwards an overview of what can be done with CouchDB in Ruby so far. The talks were followed by a discussion that gave (hopefully not only) me a couple of new insights I want to share here - after summarizing the evening for the people who couldn’t make it. There will also be a video recording with synchronized slides of both talks be available in the next days (thanks @klimpong).

What is CouchDB

CouchDB ist the new cool kid on the block. It’s a document oriented database that has replication built in, can scale massively and uses an HTTP REST interface to query it. Documents are stored as JSON constructs and can be queried with views that are built using Map-Reduce (a smaller company called google has had a bit of success with that recently). Oh and it’s written in Erlang. Jan has given a number of talks on numerous events already, so there are already a couple of videos and slides available - not from the hands on part though :) For that you should watch his blog I guess.
(more…)

CouchDB-Workshop

Wednesday, September 17th, 2008 by Alexander Lang

Am 22.9. 2008 gibt es einen Workshop zu CouchDB mit Jan Lehnardt (CouchDB maintainer) und mir. Nach einer kurzen Einführung wird der Fokus vor allem auf hands on experience liegen, d.h. es wird Beispiele und Code geben. Nach Jans CouchDB-Teil werde ich einen Überblick über die derzeitigen Ruby-Bibliotheken geben und wie damit der schnelle Einstieg zu schaffen ist.

“Leider” sind bereits alle Plätze ausgebucht, da wir nur begrenzt Stühle zur Verfügung haben. Wer trotzdem kommen will trägt sich am besten in die Warteliste ein und begnügt sich dann eventuell mit einem Platz auf dem Boden. Sicherlich wird das nicht der letzte Workshop bei uns sein. Mal sehen was uns demnächst noch so alles einfällt…