Monday, April 27, 2009

Call for help - Cheap grails hosting for small apps?

Even though the rewrite of Brewerfan.net is in the forefront of my mind, the recent NFL draft has reminded me about how much I've been ignoring my other side venture, LambeauLeap.net. It's an app that I wrote in ASP.NET using DataTables and TableAdapters when I was told that they were the wave of the future *wretch*.

Now that I've seen how quickly and nicely I can write domain-driven apps with Grails, I'd really like to start from scratch with it, and give my staff and my users an app that doesn't feel like a lame afterthought.

The problem with Grails apps is that they have a pretty healthy memory floor. The other problem is that I don't really have the knowledge or the patience to learn how to administer a Linux box, which is the cheapest way to host a Java app if you need any kind of memory.

I really don't need a multi-node scalable solution like Mor.ph, which I'm using for Brewerfan.net. I'm looking at an app which at most will probably have 15-20 tables/domain objects and probably 50 pages. Anyone have a cheap-ish solution, which doesn't have me administering a Linux box from scratch?

Thursday, April 23, 2009

two nodes, not a crowd on my cloud, baby

At Brewerfan.net, we've been blessed to have some of the best free amateur draft coverage on the 'net (a quick plug here... our 'draft guy', Patrick Ebert, has started a new venture called 5-tool talk which sort of spins this off). While it's been an awesome thing for the site, day one of the draft has historically caused the site to crash really badly under the load.

I had a conversation with my current provider about moving to Grails, and they said they were OK with it, but the fact remains that I'm saddled with a RAM limit of 150 MB. One of the drawbacks to Grails is that it does have pretty significant RAM usage (especially since I'm planning on caching a fair amount of data), so even if I were to look at this problem in isolation, I just don't think my current provider is going to cut it anymore.

After search for a while for Grails hosts, I ran across one of them, Mor.ph. One of the newest buzzwords in the industry is "cloud computing", which basically can be summed up as a shift from a traditional "site on a server" model to a virtualized model where you really are just paying for scalable computing costs.

Anyways, Mor.ph offers developer accounts which allow you to deploy your application for free. The only drawback appears to be that your URL has to be yourname.morphexpress.com (no top level domain). I'm also assuming that there are other limitations in place that would dissuade you from using a free developer account for a production environment. Mor.ph allows you to buy credits at a dollar a piece, which buys you a "cube" for a day (where, in their Grails world, means an instance of Jetty with 256MB of RAM). Not too shabby. So, basically, for $30 a month, I get two nodes, each of which have 100+ MB more ram than I currently have on the server I pay $50 for. Seems like a no-brainer.

The other very interesting thing is that this ties back to a solution for my draft day problem. Mor.ph allows you to scale up to 12 "cubes" for your app, and you can change the number of cubes you use in real-time with their very slick web control panel. So, I could run things in such a way where I pay $1 a day in the offseason, $2 a day during the season, and $6 on draft day (or any other combination) and can keep my app feeling zippy.

There's a custom deployment program that Mor.ph distributes to deploy your war file (although there's a Grails plugin which makes setting up your war file for Morph a breeze). That's the only unusual thing about the process (and even that's very painless). The other snag is that you have to refer to the file system using a specific virtual path (which in a clustered environment would be required anyway), but it's very well documented.

All in all, I'm pretty excited to move Brewerfan into the "cloud".

Over and out,
Brian

From Java to .NET and back again

I was fortunate enough in college during summers to have worked for a company doing data entry that had room to grow in, from an IT perspective. Since I was going to school for a Management Computer Systems degree, I obviously had programming somewhat on the brain. After making some cheesy VB app to do some mortgage calculations, I was recruited to do an internship during my final semester of school for one of the company's smaller startup branches. Being a small startup company around the year 2000, Java was a very hot technology, and I was lucky enough to be able to jump into that, instead of having to wade through old legacy applications that were written in COBOL.

After about 6 months of struggling through the gig, the lights upstairs finally clicked on, and object-oriented development finally made perfect sense to me, and I started to enjoy my job immensely. At the time, the .com bubble hadn't burst yet, so I was bouncing through companies that would pay an inexperienced developer like myself pretty decent money if you could even spell Java. Unfortunately, all that fun came to an end when the bubble burst. I had gotten laid off from two jobs within 5 months time. While I was able to ratchet up my salary in a short amount of time, I had priced myself out of the positions companies were offering for people with my experience (1-2 years).

The bright side of this is that I was able to focus my time and keep my Java "nails sharp" by working on a small website I started, Brewerfan.net. The idea was that I could use Brewerfan to work with technologies that I didn't get to work with while I was unemployed. Revolutions were starting to take place in the Java space with open source frameworks like Struts 1, NHibernate, and then the Spring Framework. It was at this point that I had the opportunity to go the .NET route, hopefully widening my employ-ability, or stick with Java and the frameworks that I've come to rely on (which at the time weren't available in the Microsoft stack).

Fast-forwarding to 2006, I had come to a crossroads in my career. I was serving as a technical lead for some decent enterprise-size projects, and found myself being pushed more into management than I really wanted to be. As much as I liked coaching others and managing a successful team of developers, I wanted to get out of the somewhat political atmosphere that goes along with those things, and accepted an offer from my current employer. It was a change, going from a "techincal lead" to just a "consultant", but I just didn't think at that point in my life, I wanted to remove myself from programming the majority of my day.

The real only downside to my new gig was that they're completely technologically agnostic. While I despised Microsoft programming technologies at the time, there was going to be a good chance that I would have to jockey back and forth between technologies, depending on what the client ultimately chose. Until recently, ALL of my projects have been in the .NET stack, so I drank the kool-aid. At first, I was pretty much kicking and screaming, as all of the technologies I had relied on (Aspect-Oriented programming, Object-relational mapping) didn't exist in the Microsoft space. After trying to "play nice" with some of the rapid application development tools that MS provided, I ultimately pushed for our company to explore some of the "alt.net" technologies (Spring.NET, NHibernate). While I thoroughly enjoyed working with ASP.NET and the ease of which I could create a small website and deploy it, the whole thing still felt like one big hack to me. I could develop a superior product with C#/ASP.NET/alt.net than I could with Struts/Spring/Hibernate, but the lack of using 100% supported Microsoft tools is sometimes met with hesitancy with developers I work with. It's also a bit cumbersome to use Microsoft development tools with non-sanctioned products.

Regardless of this unease, I made the decision to go ahead and re-write Brewerfan.net with an ASP.NET/alt.net architecture, as it was something that I was pretty comfortable with. All of that changed, when a co-worker of mine recommended I check out a video called "Building Twitter with Grails in 40 Minutes". I had a brief fascination with Ruby on Rails a couple of years earlier, but it got left by the wayside as I already had to learn .NET for my new gig, and I didn't really envision a scenario where I would get to use Ruby in a production setting anywhere. As soon as I got done watching that video, I completely abandoned my newly formed Brewerfan.net .NET codebase, and started writing it in Grails.

Much as I had grown to despise Microsoft technologies during my "Java phase", I had grown tired of Java's bulk during my ".NET phase". Grails, being built on top of Java, is a much easier pill for companies to swallow, since Java runs on pretty much anything with a chip in it. And for me, it removed the rest of the complexity and the hurdles I had to jump through in the .NET space to build a quality project in a fast amount of time.

So, as it stands, I'm back in the Java camp... although, I suppose if you want to be specific, I'm in the SpringSource camp. I finally feel confident in a technology for my Brewerfan.net re-write, and confident in a technology that I can use in the workplace and hopefully make a real difference.

That's all for now,
Brian

Wednesday, April 22, 2009

DNS frustration

While my current host, MMA, has been very responsive over the past 5 years or so that they've hosted Brewerfan, we've really outgrown the limitation of running the site off a single server. The first step I've taken in transitioning from one host to another was to take our hosted email (used by our staff members who have custom brewerfan.net email addresses) to another host.

Dotster, who's my vendor of choice for domain name registration, does email hosting for 99 cents a month (10 email addresses, which is just about right for the amount of staff we have, and 1.5 GB of space as compared to a TOTAL of 1GB of space that my current provider gave me [and that includes DB space and file sapce]), so I went with that.

They asked if I wanted to transfer over my DNS entries. Assuming that since I had just signed up for email hosting and nothing else, I assumed that they would just transfer over my MX records. To my chagrin, I started getting complaints from users that they couldn't see the site anymore. Dotster had taken the liberty of transferring all the DNS entries (including the "A" records which point to my web server) to their name server.

Dotster's instructions about how to change MX records were abysmally innacurate, so I had to start the task of opening a dialog with them via a trouble ticket. I hope this goes smoothly, since dealing with companies via generic feedback mechanisms just never seems to go smoothly.

Here's to a quick resolution,
Brian

First Post

My past attempts at blogging have been pretty lame, largely because of a lack of discipline on my part, but also largely because I really didn't feel like I had much of a unique perspective on things. One of the things I'm the most proud of, quasi-professionally, has been launching Brewerfan.net and watching it grow since its inception in 2001.

I'm deeply involved right now in the re-writing of Brewerfan.net's "main site" (by this, I mean everything but that Fan Forum which is a hosted application by Yuku. I figure that I'd sort of document the process involved in doing this, as well as throwing other personal and professional insights from my day-job and whatever happens to interest me at the time (which, outside of work, trying to get into decent physical shape, and sleep isn't all that much).

So, anyways... Feel free to comment if there's something you'd like to know more about regarding Brewerfan, or just in general. Hopefully some of the pitfalls that I come across while re-building the site and then developing the site further I can document here, so that other people can learn from them.

Adios for now,
Brian