Vincent Toms

iOS programmer living in Boston MA.

Experimenting With a New Development Stack

I recently made the switch from Wordpress to Octopress as my blogging tool of choice. The transition for me was painless because I had just installed wordpress as a place holder and had made a few posts calling for user feed back from an app I built. Which by the way if you have the Betterman app rest assured it is being worked on and a new release is in the works. If you want to contact me about it, please don’t hesitate to email me vincent@vincenttoms.com.

In any event, I am perpetually searching for more optimal web stacks. Initially, this meant moving away from Linux to FreeBSD. My reasons are many but frankly I find that the BSDs are more along the lines of work horses where as Linux feels like a bit of a toy. I am sure this will get a lot of people up in arms, but the point isn’t to stir the pot it is just my observation and after having worked on various UNIXs over the last 18 years I think it is safe for me to state my personal preference. Truth be told I better know how to admin the system and so for me this is a matter of comfort.

My next choice was to drop MySQL in favor of MariaDB. The reason behind this one is because I am a bit concerned that in the next few years out buddies at Oracle are going to put the hurt on all the companies that have built applications based on MySQL. This might be just an irrational fear but I don’t want to take any chances. I know postgres exists as an alternative as well, but presently I would rather go for something that is going to drop in rather than rebuilding reconfiguring and migrating. I have some applications in the pipeline that will probably lead me down a road towards psotgres but I’ll cross that bridge when I get there.

My next choice was to move from Apache to Nginx. My good friend Ricky had been preaching to me about the power of nginx, and I never really listened. Simply put I know how to turn up an apache server almost with my eyes closed and in the past it worked. However, when I moved to Octopress I was given a unique opportunity. My blog went from this dynamic thing to a site that was all static pages, not only that I moved it from my beast server to a little experimental machine I had setup but never really used. This computer was resource strapped both in CPU and memory and simply put trying to fit apache in there was going to be a nightmare. I debated between lighttpd and nginx, and arrived at the conclusion to go with nginx because there was phusion integration. So far I have not been let down. This simple little server rips through requests and all the while hardly touching my CPU or memory. I have since then added more ram to this machine, installed phusion and frankly I think with a little more tinkering I’ll have php going via FPM. With this stack I’ll have no problem deploying pretty much 99% or what I’ll ever need it for.

I opted to go with phusion in lieu of unicorn for running my ruby apps because it will allow me to run multiple apps with much less resources. With unicorn you preallocate instance to run your app, and you have to do some additional scripting to ensure you process are running. With phusion you simply point to the directory where the app lives and it will take care of the rest. Additionally, it will reclaim resources as utilization goes down and ramp up as needed, it may not be perfect but in the production rails apps I have deployed it works quite nicely and hasn’t given me any fits.

I am additionally, going to skip php for my quick and dirty apps and start using Sinatra & Datamapper. Datamapper is a nice little ORM that frankly makes my life a bit easier I can skip writing SQL and get good performance. As for Sinatra this nice little tool lets me work in Ruby and build easy web apps. With the ngnix stack I can still toss my php files in the public folder and they’ll execute right along side of the Sinatra over all making this a nice little stack with a lot of flexability.

Comments