Skip to main content

Posts

Showing posts from 2011

Why I Like PostgreSQL

Today I gave a short presentation at work about PostgreSQL, and why I much prefer it to MySQL.

PostgreSQL vs MySQL: Eternal Battle
I may be misreading this, but it seems that there is a recent trend within startups to move away from MySQL, probably thanks to folks like Heroku on one side (who use PostgreSQL to the extreme, and help and contribute to it's development), vs folks like Oracle on the other side, tainting the "open source pureness" of MySQL :)

At my work we currently use a mid-sized MySQL 5.1 Percona instance, which is holding up quite well I must admit. Both PostgreSQL and MySQL have definitely converged to cover most features that people want, but my leaning is still towards PostgreSQL. I just agree with it's focus on data integrity, recovery, constraints, extensibility, while some of the early decisions in MySQL's design do not agree with me at all (like truncating long strings, 1/0 instead of booleans, ambiguous group by, etc). I think that data …

Ruby, Mac Ports and OS-X Lion

Today I upgraded my work machine to OS-X Lion. As I do ruby development on my machine, I quickly stumbled upon a problem with installing "nokogiri" gem. I was getting this error:

Installing nokogiri (1.5.0) with native extensions [snip] `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /Users/kig/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb checking for libxml/parser.h... *** extconf.rb failed ***
In addition to installing new XCode from the app store, I also have Mac Ports installed, and so I had to perform the following command to allow nokogiri to build:
sudo port upgrade libxml2 libxslt

After this command completed, Nokogiri happily found libxml and it's dependencies.

UPDATE: Note that I no longer recommend installing libxml2 via ports. Use brew + rbenv instead.

New iMacs are Fast. Really Fricken Fast.

I finally upgraded my home workstation to one of the new just-released iMacs, which are reported to be the fastest Macs ever by MacRumors. I concur! They are really really fast! For us rubyists, here are some benchmarks building Ruby VM on this machine using RVM (my home directory is on the SSD drive): Ruby 1.8.7 (14 seconds to download) real 1m20.815s user 0m48.298s sys 0m11.479s Ruby 1.8.7 Enterprise Edition (13 seconds to download) real 2m28.106s user 1m54.450s sys 0m14.372s Ruby 1.9.2 (download time 38 seconds) real 3m0.167s user 1m56.891s sys 0m19.959s Model Info: Model Name: iMac Model Identifier: iMac12,2 Processor Name: Intel Core i7 Processor Speed: 3.4 GHz Number of Processors: 1 Total Number of Cores: 4 L2 Cache (per Core): 256 KB L3 Cache: 8 MB Memory: 8 GB

mc-settings: Gem created at ModCloth for managing configuration

We at ModCloth have been for a while focused on sharing some of the code we've written with the community, to give back to the open source.
MC-Settings is a cute little gem that provides smart ways of managing your multi-platform/per-deployment application configuration in a convenient set of YAML files, which are easily managed and activated using Capistrano.
For example, beyond configuration that is specific to Rails environment (such as production, development, etc), you may have configuration that is machine specific, or a cluster specific, etc. For example, if you run on multiple clusters, application servers on one cluster may need to use one set of MemCached servers, while your second cluster could have another set. How do you manage configuration in your deployments in such a way that allows sensible defaults, and per-system, cluster, environment overrides?
This is where MC-Settings gem comes in. Read up below on how to use the gem, and typical patterns that work with Ca…

RailsConf 2011 Best of Sessions

Below I put together my personal list of best RailsConf 2011 presentations that have online slides or PDFs. I put my comments next to each. Click on the link, then click on the "slideshow" or "PDF" links for each talk.ActiveSupport 3: What We Should Know About What We Don't Know - how to use ActiveSupport in your ruby apps and get lots of behaviors and useful stuff for freeBuilding Bulletproof Views really decent presentation on state of views in general, and best practices. Recommended reading.Building Pageless Apps with Rails and Backbone JS is a great presentation on a new up and coming JS client side framework for building reach apps on the client using pure MVC.David Heinemeier Hansson -- keynote, worth watchingFrom 1,000 Transactions a Month to 1 million in a Day: Lessons in Credit Card Processing from LivingSocial - cool presentation on how BrainTree API is used to encrypt card data in JavaScript before submitting to BT for processing. Lots of other us…

mms-mime: MM7/MMS MIME parsing gem

https://github.com/kigster/mms-mimeThis gem was written with a simple aim to parse MM7 wrapped binary and base64 encoded MMS messages received via MM7/XML HTTP post from an MM7 compatible gateway connection (such as OpenWave, OpenMarket, etc).The gem provides a simple way to parse and access MMS message contents, such as from, to, subject and content parts (including image and text parts).