Spree and Software Development: Git and Ruby techniques
Having tackled a few interesting Spree projects lately, I thought I’d share some software evelopment tips I’ve picked up along the way.
Gem or Source?
The first decision you may need to make is whether to run Spree from a gem or source. Directions for both are included at the Spree Quickstart Guide, but the guide doesn’t touch on motivation from running from a gem versus source. The Spree documentation does address the question, but I wanted to comment based on recent experience. I’ve preferred to build an application running from the gem for most client projects. The only times I’ve decided to work against Spree source code was when the Spree edge code had a major change that wasn’t available in a released gem, or if I wanted to troubleshoot the internals of Spree, such as the extension loader or localization functionality.
If you follow good code organization practices and develop modular and abstracted functionality, it should be quite easy to switch back and forth between gem and source. However, switching back and forth between Spree gem and source may not be cleanly managed from a version control perspective.
git rebase
Git rebase is lovely. Ethan describes some examples of …
rails spree
Xen MAC mismatch VNC mouse escape HOWTO
This is a story that probably shouldn’t need to be told if everything is in documentation somewhere. I’m not using any fancy virtualization management tools and didn’t have an easy time piecing everything together, so I thought it’d be worth writing down the steps of the manual approach I took.
Dramatis personæ:
- Server: Red Hat Enterprise Linux 5.4 with Xen kernel
- Guest virtual server: CentOS 5.4 running paravirtualized under Xen
- Workstation: Ubuntu 9.10
The situation: I updated the CentOS 5 Xen virtual guest via yum and rebooted to load the new Linux kernel and other libraries such as glibc. According to Xen as reported by xm list, the guest had started back up fine, but the host wasn’t reachable over the network via ping, http, or ssh, including from the host network.
The guest wasn’t using much CPU (as shown by xm top), so I figured it wasn’t just a slow-running fsck during startup. And I was familiar with the iptables firewall rules on this guest, so I was fairly sure I wasn’t being blocked there. I needed to get to the console to see what was wrong.
The way I’ve done this before is using VNC to access the virtual console remotely. The Xen host was configured to accept VNC …
hosting redhat tips virtualization
PostgreSQL Conference East 2010 review
I just returned from the PostgreSQL Conference East 2010. This is one of the US “regional” Postgres conferences, which usually occur once a year on both the East and West coast. This is the second year the East conference has taken place in my home town of Philadelphia.
Overall, it was a great conference. In addition to the talks, of course, there are many other important benefits to such a conference, such as the “hallway tracks”, seeing old friends and clients, meeting new ones, and getting to argue about default postgresql.conf settings over lunch. I gave a 90 minute talk on “Postgres for non-Postgres people” and a lightning talk on the indispensable tail_n_mail.pl program.
This year saw the conference take place at a hotel for the first time, and this was a big improvement over the previous school campus-based conferences. Everything was in one building, there was plenty of space to hang out and chat between the talks, and everything just felt a little bit easier. The one drawback was that the rooms were not really designed to lecture to large numbers of people (e.g. no stadium seating), but this was not too much of an issue for most of the talks.
A few of the talks I attended …
community conference database postgres
LibrePlanet 2010: Eben Moglen and the future of Oracle in free software
I just got back from Libre Planet 2010, a conference for free software activists put on by the Free Software Foundation. I imagine most readers of this blog are familiar with the language debate over free software vs. open source. Much of the business and software community has settled into using open source as the term of choice, but Libre Planet is certainly a place where saying “free software” is the norm.
I presented two talks—one on how to give good talks by connecting with your audience, and a second about non-coding roles in free software communities. The first talk is built on my work with user groups and giving presentations at primarily free software conferences over the last five years. The second was built off of the great work of Josh Berkus, for a talk that he first gave at a mini-conference I arranged the day before OSCON 2007 for Postgres.
One talk I attended surprised me with an important discussion of the future of the open source database market.
Eben Moglen spoke about the future of the Free Software Foundation and the new challenges that software freedom faces in a world increasingly dominated by network services—social networking, collaboration tools and …
conference open-source postgres
Using psql \o to append to a file
I had a slow query I was working on recently, and wanted to capture the output of EXPLAIN ANALYZE to a file. This is easy, with psql’s \o command:
5432 josh@josh# \o explain-results
Once EXPLAIN ANALYZE had finished running, I wanted the psql output back in my psql console window. This, too, is easy, using the \o command without a filename:
5432 josh@josh# \o
But later, after adding an index or two and changing some settings, I wanted to run a new EXPLAIN ANALYZE, and I wanted its output appended to the explain-analyze file I built earlier. At least on my system, \o will normally overwrite the target file, which would mean I’d lose my original results. I realize it’s simple to, say, pipe output to a new file (“explain-analyze-2”), but I wasn’t interested. Instead, because \o can also accept a pipe character and a shell command to pipe its output to, I did this:
5432 josh@josh# \o | cat - >> explain-results
Life is good.
Update: A helpful commenter pointed out I hadn’t actually used the same files in the original post. Oops. Fixed.
postgres
MountainWest RubyConf 2010 — Steph’s Notes
Last Thursday and Friday, I attended MountainWest RubyConf in Salt Lake City. As usual with any conference, my notebook is full of various tools and tips jotted down for later investigation. I thought I’d summarize some of the topics that grabbed my interest and go more in depth on a couple of topics in the next couple of weeks.
-
Lambda: In a talk early in the conference, lambda in Ruby came up. I had a hard time coming up with use cases for its use in Rails or a web app in another server side language with equivalent functionality (Python, Perl), but I’d like to look into it. An example was presented using Ruby’s lambda to calculate Google’s PageRank value, which is particularly appealing to my interest in SEO.
-
Chef: I’ve heard of Chef since I started working with Rails, but have yet to use it. After my recent adventures with Spree on Heroku, I see the value in becoming more familiar with Chef or another configuration management software tool such as Puppet. I’m particularly interested in creating some Chef recipes for Spree.
-
RVM: RVM, or Ruby Version Manager, is a nice tool to work with multiple Ruby environments from interpreters to sets of gems. For a couple of …
conference rails ruby
NoSQL Live: The Dynamo Derivatives (Cassandra, Voldemort, Riak)
For me, one of the big parts of attending the NoSQL Live conference was to hear more about the differences between the various Dynamo-inspired open software projects. The Cassandra, Voldemort, and Riak projects were all represented, and while they differ in various ways at the logical layer (how one models data) and various features, they all share a similar conceptual foundation as outlined in Amazon’s seminal Dynamo paper. So what differentiates these projects? What production deployments exist and what kind of stories do people have from running these systems in production?
Some of these questions can be at least partially answered by combing the interwebs, looking over the respective project sites, etc. Yet that’s not quite the same thing as having community players in the same room, talking about stuff.
Of the three projects mentioned, Cassandra clearly has the “momentum” (a highly accurate indicator of future dominance). To me, this felt like the case even before Twitter started getting involved with it, but the Twitter effect was pretty evident based on the number of people sticking around for the Cassandra break-out session with Jonathan Ellis, compared to the break-out …
database nosql
Quick Thoughts on NoSQL Live Boston Conference
I’m back home now from the Boston “NoSQL Live” conference organized by 10gen.com (the MongoDB folks). It was a good event. A lot of stuff covered, a broad range of topics. I have a fair amount to say, but need to digest, review notes, etc. In any case, thanks to 10gen and the various sponsors that made it happen.
Some quick, random thoughts:
- Picking a good table at lunch is key: we ended up sitting with four different presenters, including Jonathan Ellis for Cassandra and Alex Feinberg for Voldemort, which happen to be two of the systems I’m personally most interested in using at the moment.
- There is an undeniable latest-thing-fan(boy|girl)ism aura surrounding the “NoSQL” brand/meme/whatever, but the various presenters and leading lights in various projects appear to be reasonable and fact-based; don’t let the breathless silliness of fans fool you.
- I went in feeling convinced of the desirability of non-relational datastores for specific modeling situations (graphs) and for scalability/availability/volume concerns (Dynamo and BigTable derivatives), while feeling relatively skeptical of “document datastores”. I left feeling basically the same way, though decidedly less skeptical of …
database nosql mongodb couchdb