Several techie friends recently asked what technologies I would recommend if I was to set out today on building a new web app / web service. I’m not sure I’m the best person to ask, but I guess if you’re coming from a “real job” into the startup space it can be daunting figuring out what’s worth investigating. So, in the spirit of helping more people, here’s my quick and highly opinionated braindump on this topic, based on what I’ve learned so far building 5 Blocks Out.
it’s so SHINY!
Since I’m dispensing unsolicited advice, let’s start with this: understand the problem you’re trying to solve before building your technology shopping list. If you don’t do that you will find yourself wasting time playing with shiny new stuff that doesn’t really help you build the software you want. Mmm, shiny.
On to the list.
- In the Ruby domain it’s worth looking at Rails…
- …and Sinatra: much simpler than Rails and, I think, more fun. Great for small and low-in-the-network-stack apps.
- I hear the new .NET MVC stuff is not bad. It sounds like they learned a lot from Rails, which is great.
- Many friends of mine do Drupal development. Looks nice for CMS apps.
- I hear Java people are playing with groovy and grails. Can’t help you there.
Naturally, you need to deeply understand the app you’re trying to build in order to make a smart decision about data storage technologies. That said,
- MySQL and PostgreSQL are both great for relational data storage. We use PostgreSQL for 5 Blocks Out and I like it a lot. If you’re already familiar with one of these, it’s hard to justify switching.
- Looking at how 5 Blocks Out has evolved I now wish I had started with MongoDB instead of PostgreSQL or MySQL. If you have a chance to play with it then do. It seems a really nice fit to apps that want everything to be denormalized, which many web apps do.
- CouchDB is also worth looking at, if you’re considering MongoDB and document-oriented stores in general. I personally don’t like the syntax, though.
- See also Cassandra. It’s overkill for anything I’ve wanted to do, but if you’re storing large amounts of data that isn’t normalized or regular in structure, it’s worth a look.
- Redis is a pretty awesome in-memory key-value store. Nice for certain kinds of apps. Wish I had an excuse to use it.
- In general, look up “NoSQL” and read about the vast array of fun new stuff
If you are using Rails…
- Start by installing RVM and using it with gemsets to install, switch between, and test your Ruby versions and gems
- Use Rails version 3 unless you really have to use a legacy version
- This site tells you which Rails plugins work on v3.
- Rails wants to start you with ActiveRecord as a storage wrapper. That’s great for SQL-based apps, but you might not want AR if you’re using no-SQL stores like MongoDB.
- Test frameworks: RSpec and Test/unit are the ones I like best.
- Some people — not me — prefer Shoulda to RSpec.
- Cucumber is a popular companion to RSpec for integration testing.
- Ruby/RailsTextMate has great plugins for Ruby, Rails, HAML, SASS
- Search for “rails version 3 application templates” to see if anyone has already packaged together a starter kit you like
Lower-level stack: OS, Web, and Application Severs
I try to spend as little time at this level of things as I can. But I keep getting dragged back…
- We use nginx, not apache. Simpler, very fast, secure.
- We use Passenger and Ruby Enterprise Edition with nginx. But there are many app servers for Rails, e.g. it comes with Mongrel.
- We require Unix of some flavor. Right now we use Ubuntu and I develop on the Mac (which rocks, ‘cuz it runs all the same stuff as our server).
- I would not recommend Rails on Windows… I’ve tried it, it’s painful.
- Monitoring: monit, god, New Relic
- Deployment and Server config: Capistrano or Vlad the Deployer
- Server Config: Chef looks pretty hot. Haven’t tried it yet. Want to. I know there are a few other options here, would love to hear of something simple that works well.
- jQuery is great and has a ton of free plugins, plus jQuery Themes. I highly recommend it. I started on Rails with Prototype, but jQuery feels more natural to me.
- I use HAML for all our HTML generation, and SASS for CSS generation. I *love* these.
- Get smart about HTML5
Other bits and bobs
- I use TextMate as my editor. Nice if you develop on a Mac.
- I am not a big fan of IDEs, and if I was I’d still be using Visual Studio with whatever the latest and greatest .NET stuff is. (Yes, I’ve tried NetBeans, and a bunch of other ones. Slow, buggy, ugh. Give me text.)
- homebrew is a nice package management system for Mac OS X
- Amazon EC2 and Azure
- Amazon S3 for bulk storage
- Amazon CloudFront for CDN
…and survey the growing number of services following in Amazon’s footsteps.
Start by reading this amazingly comprehensive presentation on the mobile landscape. Then…
- From my buddy Phillip, who is much smarter about this than me:
- iPhone/iPad if your target audience is that small number of people rich enough to have one. But beware, they’re very different from everything else, require you to be tied to a Mac, and Objective C will give you a headache.
Queueing and Working Offline
If you are thinking about web apps you should also get familiar with queues that will let you do work offline, asynchronously from end user requests. For instance, sending emails offline, rotating images, generating newsletters, etc. This technique is vital in Rails, since Ruby is interpreted and it’s easy to write inefficient Rails code that results in long HTTP request times.
- On top of my list is “resque” which uses Redis. See also this great blog post on resque.
- BackgroundJob and Delayed Job are very popular in the Ruby world. There are tons of queues.
Again, wish I had started using queueing way earlier for 5 Blocks Out.
Repository / Source Version Control