Tuesday, September 16, 2008

Here we go!

So I just started a large RoR project and thought I would set up this blog to share my frustrations and triumphs in case anyone else starting out in the Ruby world might benefit.

To be honest, this isn't completely magnanimous. I needed a place to log stuff that I've done so I don't forget it. But I figured a blog would be better than a notebook because someone else might learn something, too.

The project is essentially a Contact Management System (pretty dry stuff I know). But it's a large enough project with enough features that I thought it would be a good foray into this world and give me lots of material for a blog series.

Our first challenge is making sure that the system's search features are very fast. We're talking about large amounts of data here (millions of records across multiple tables). The users will need to be able to search for terms across multiple fields in those tables and it will have to be fast!

So my first step is to generate large amounts of realistic test data. Not a very pleasant prospect to be sure. Generating realistic names, addresses, phone numbers, etc. is not simple. Or so I thought. After starting to monkey around with creating a ruby library to generate this stuff for me (without a lot of progress), I stumbled on this railscast about setting up realistic test data. Wow! Not only is this my favorite rails site, but this railscast was posted the day after I started trying to do this! How did he know? Ryan Bates does an awesome job explaining this stuff. I would highly recommend that all RoR n00bs watch every episode!

I installed the two gems and followed the simple instructions and viola! my data is populated. It took me just a couple of hours to get a complex database set up with lots of realistic looking data. And that included setting up all of my models! (I know, RoR masters probably could have done it faster, but I was jazzed!) Very, Very Cool!

Next, I'm going to be experimenting with the search engines. Thinking Sphinx looks very promising for what we're doing. I'll post about my experience with that in the next blog. In the mean time, I'd recommend watching this railscast about Thinking Sphinx (RailsCasts again).

See ya next post!


No comments: