mongodb, bookstore, api [day 27]
The first productive thing I did today was informing myself about NoSQL databases. I figured my restarting book catalog project use such a database, because a lot less modeling needs to be done. On the first try of this project, I put a lot of thought into “how to set up the book-author and book-category relations”. I assume that these kind of questions can be avoided by using document databases, but it’s an experiment.
My decision for a document database fell on the most popular one called MongoDB. Although I dislike the name (apparrently it stands for “hu-mongo-us”, because it’s capable of handling that much data), I think it is conceptually quite nice. It seems to have nice Python bindings and through it’s popularity also documenation available.
To get started, I opened the book “Seven databases in seven weeks”, which is one predecessor of the other seven weeks book that I’m working through. Luckily it contains a chapter on MongoDB. After roughly picking up how the infrastructure works (MongoDB’s commands are directly built in JavaScript. That was a surprising concept), I kind of wanted to get the project going. But I procrastinated a bit. Luckily I found someone to pair with later.
Procrastination and city exploration intermezzo. I walked with two other people to a nearby bookstore. As I’m writing a book catalog, this was a good inspiration ;-) Also it was a special kind of bookstore (this one), where all of the profits go to the housing works project. It’s a bookstore full of used books, but very well organized. I was looking for book by their size. I wanted to have a small book. One that is comfortable to read on the subway, even if one of my hands is occupied with preventing my body to fall through the car while I’m reading without having a seat. I found one that fit’s my needs perfectly (it even has a nice red bound bookmark) and the cover text convinced my immediately.
In the evening I started on the Web API for the book catalog, supported by Nasreen who assisted me to get things done (instead of thinking about them and perfectioning them in my head). We had some nice dicussions again about what an API even is, how to test one (we even wrote tests today!) and what HTTP codes have to do with that. Here’s the current progress.