|
When I envisioned FileIt.in, the immediate thought which wanted to not make it was this: the boredom of programming such an application. The DataBase JDBC code which I need to write, all the Connection, PreparedStatement and ResultSet objects I need to close properly, and so on. Not to let such implementation details worry me, I started exploring alternative storage units.
Why not MySQL
- Boredom of programming JDBC (I hate Hibernate).
- RDBMS does not map well to content structure like FileIt.in (the thought of building a tag table itself disappointed me!)
Neo4J or Redis
Somehow through my Twitter contacts I was introduced to Neo4J. The twitter community around this database was amazing. They helped me a lot in understanding the basics. I made a sample cli-application in a day (similar to FileIt.in functionality) and posted it as OpenSource:
http://code.google.com/p/subwiz/
I loved their simple API, their enforcement of Transaction and beauty of reuse due to the Graph model. An image representation of the data model Neo4J created from my cli-application is available here:
http://www.flickr.com/photos/subwiz/4295520998/
When I was about to fix this as the DB of choice, I happened to discover their license: AGPL. AGPL means I need to OpenSource my web-application code too I am to use Neo4J free of cost. Or, I need to buy the license. I did not have the money (I had resigned from my day job to develop FileIt.in).
So once again started exploring the alternatives. Redis hit my radar. Can I design my application on a key-value model. Fortunately, there is a good tutorial in the Redis site on how to develop a Twitter clone using Redis:
http://code.google.com/p/redis/wiki/TwitterAlikeExample
This helped me understand how to design an application for using key-value database.
I did that, and now you are seeing the result!
Programming Language
I wanted to do FileIt.in in Scala. I loved its succinct syntax and functional features. But lack of proper IDE support in my favorite IDE Netbeans was a show stopper. I was not being as productive as I am when programming Java. So I choose Java.
FileIt.in is programmed with few dozen servlets, JSPs and few tag libraries.
Tomcat & Nginx
For deployment I had the following choices: Caucho Resin, Jetty and Tomcat. Tomcat seemed to consume the least RAM when running FileIt.in. So finalized on Tomcat.
For the Web Server I was using Apache2. And then someone in Twitter mentioned Nginx. So much smaller, faster and easier to configure! Picked it for proxying requests to Tomcat.
|