FiBiRi.com running on Grails

I’ve been working on FiBiRi.com on and off for about two months and I finally got it live. It is still kind of in alpha stage, but the functionality is largely there. This is my first serious application written using Grails, and I must say I’m hooked.

Of course I’ve dabbled a bit here and there, but there is nothing like a real app to learn a new framework with. I had some minor pains but nothing too bad. All told I have about 120 to 160 hours in it which isn’t too shabby. A good portion of that time was learning grails and groovy so if I had to do again I could probably shave a good 20 or so hours off of that development time.

Things to do

There is still a lot content left to add along with the monetization stuff. I still have a few functionality items to add, mostly to do with the itineraries but I’m pretty happy with it. There is actually almost as many hours in gathering the content as there is in development time. Needless to say that ratio will only get wider as more content is added. It is also only focused on Las Vegas, but is set up so that any city or destination can be added so there is room to grow.

Technical details

There are 23 controllers, 18 domain classes, two services and two custom tag libraries along with 60 or so view pages (mostly admin). It is running in tomcat 6 behind nginx on a small Linode.com box with MySQL as the database.

I could have run it straight on tomcat, but chose to front it with nginx for a couple of reasons. One because I wanted to try nginx (I love it…) and two because I can later do some fancy caching behind it using memcached.

If anyone has any suggestions, feel free to let me know!



Don't miss anything, subscribe!

Please trap your errors!

It just plain looks really, really bad when you have a public facing site and you don’t trap errors. Here is from Staples.com today (1pm PST):
Staples



Don't miss anything, subscribe!

Will document databases make an impact?

There has been a lot of buzz about Amazon’s SimpleDB and other related projects like CouchDB, Google’s Datastore and Thrudb. Personally I think they will all find a niche in modern web applications, but what I find amusing are the nay-sayers that talk about the faults and even saying they aren’t even databases.

Come on, not a database? What are these people smoking? Since when does database == relational ? So they don’t support all transactions, aggregate functions or other features that are common to RDBMs. Did it ever occur to these people that not all applications need these features?

Scalability

The prominent feature for these document style databases is scalability. One guy equates scalability to the number of rows in the database. Uhh, maybe someone should explain to him what scalability means. Who cares if you can put millions of rows in your db if you only have 100 users? What about say a few hundred thousand rows but millions of users? It isn’t necessarily the number of rows you can store but how quickly you can get data out to your users.

Where are my joins?

Others go on and on about how you can’t do things like join data across tables. There are many big sites that actually store data in multiple places. Yep, denormalizing (gasp!) their data in the name of speed. Sharding also fits into this category. Although generally sharding happens on a traditional RDBMS, the effect is the same, spreading data out for scalability sake.

It all comes down to the right tool for the job. Until recently RDMBS were pretty much the only tool in the toolbox, whether you needed all the features or not. Now we have more options to choose from and I’ll bet that many choose the alternate route. All the nay-sayers are just scared.



Don't miss anything, subscribe!

Do you use ActiveMQ?

So I read today where LinkedIN uses ActiveMQ as part of their architecture. I haven’t used ActiveMQ personally, but we use it for a project where I work and the guy that set it up absolutely hates it now.

We were looking to use a message server for a new project and started kicking around ideas. The primary requirement was multiple language support. New stuff is largely being done in Java but we also have a really large perl codebase and some backend stuff is still be done in perl. Naturally that made ActiveMQ a front runner because of its open language support. Once he got wind of the talks it was quickly shelved with “over my dead body”.

Turns out that despite the great documentation and its visibility, it doesn’t work quite as speedy as one would think. After fixing several bugs himself (out of order messages being one that I recall), the one glaring problem is performance. Seems that if a subscriber is a bit slow, the whole server becomes slow even on the receiving end. Well, that is just counter productive in my book. The whole idea of a message system is to eliminate these kinds of bottlenecks yes?

We then tried openAMQ (a C-based server) and that shelved too because it kept dropping messages. For the time being we settled on Websphere MQ which just makes me want to puke. I know IBM has had a message server forever, but I have yet to see a piece of software they’ve written that was worth a shit.

Hopefully we can find another solution before big blue takes a firm hold on us. Any suggestions?

Any really good experiences with ActiveMQ?



Don't miss anything, subscribe!
A few more you might be interested in:
  • Lessons in scaling
  • First real-world experience with Grails

    I’ve written a little bit about grails before, but until now I haven’t had a real application to build to really put it through it’s paces. At first I was going to build this application with Rails for the same reason, even deploy it on Glassfish with its RoR support. I don’t know though, something about an application that requires a new instance for every request just seems wrong to me. Seems like such a flawed architecture that I just couldn’t bring myself to do it. Yea, there are other Ruby based web frameworks and I might try one at some time, but not this time.

    I also have to say that I generally don’t generally like any kind of black-box magic frameworks. Code generation and such tend to make me cringe, but what the hell I was going to give it a shot. Needless to say so far I’m pretty darn impressed. While I’m not quite finished it is moving along very rapidly, and adding features is pretty damn easy. I would say I’ve put in about 50 hours or so over three weeks and I am at about 85% finished.

    What I like

    This is ironic part. I really hate tools like Hibernate that force you into a specific format. Most of this stems from my corporate application experience where databases are far more complex than what ORMs like Hibernate can handle. However in this case the GORM has been a wonderful time saver. Setting up relationships has been fairly easy, although I had a few head-scratching moments that weren’t quite textbook and the docs weren’t very clear on.

    I also really like the URL mapping stuff. I’m sure Rails has a good URL mapping engine as well, but I really like being able to customize these as I see fit. I still get a bit confused on what return/render method to use in the controllers, but it hasn’t been too bad.

    What I don’t like

    About my only gripe so far is with the BootStrap class. This is a great idea and wonderful for development, but man it can be a pain. Actually the gripe isn’t so much as the BootStrap itself but with GORM. Go figure.

    There are cases where I have a three level deep object graph and populating it isn’t as straightforward as it could have been. Most of my problems have been when I populate the leaf object and then I need to get that leaf object later for some other reason. The getBy and findBy methods will sometime return a null object, even when I know the parameters are good. I end up having to retrieve its parent and then getting the child out of there. I would say I’ve spent about 20%-25% of my time just trying to get my simple test data in. I could very well be doing something wrong, but the docs haven’t shown me anything different and what seems intuitive to me apparently isn’t. Oh well.

    I haven’t been doing anything nearly as fancy as Glen Smith but isn’t a “hello world” app either. My current stats are:

    16 controllers with 864 LOC
    12 domain classes with 245 LOC
    1 taglib with 22 LOC

    I know I’m going to have to write at least one new tag lib for paging, as the provided paging taglib won’t work for me. A shame because I really need it. I should be done with domain classes but I’ll probably add a couple more controllers.

    All in all I’m pretty happy with Grails and I look forward to getting this thing public.



    Don't miss anything, subscribe!