Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Wednesday, 26 December 2012

Rails is re-inventing the wheel

In recent years, there has been a surge in web applications. To support the growing market, frameworks have developed around scripting languages for developing web applications fast. Of those Ruby on Rails seems to be the most mature. Django, the most advanced Python framework for web applications is yet to come at par with it.

Be it Django or Ruby on Rails, both follow a model-view-controller architecture to web applications. Now, many web applications using these frameworks follow 'skinny controllers, fat models'. As a result the models become home to a lot of business logic. Models are intended to serve only as an abstraction to the database. They are meant to be 'models of data'. Also, when the application grows huge, we run into issues of scalability and we resort to techniques like sharding. Now, there are of course multiple ways of sharding and you need to decide what suits you better. Here, I list a few ways for Rails applications.
Now, sometimes the sharding logic also creeps into the models. Obviously objects of model classes do not have a single purpose any more. Over time, the model classes obviously become too complicated. It becomes difficult to maintain and debug. The Rails community is becoming increasingly aware of these issues. There are multiple ways in which developers are trying to move business logic away from models. Here I list of couple of those ways.
Looking at the overall scenario reminds me of building N-tier applications using Java Enterprise Edition. The sharding logic and details of data fetching can be a tier below models and the business logic can be a tier above it. ' seems to me developers using web frameworks like Django and Rails are just re-inventing the wheel. Also, Java has optimized garbage collection which can be tuned to various needs. In Ruby garbage collection seems to be a big issue, though good work in the area is coming in the next version.

So much in the name of innovation, eh? In case my ideas seem to waver from reality do point me in the right direction.

Update: You can follow the discussion on Hacker News on the topic.

Saturday, 22 January 2011

Setting up a software project

Recently, I have started a software project with a few of my friends. I shall speak about how I set up communication media for the project. We started with creating a secret group in facebook. That way we are able to discuss the project even when we are at our homes. Facebook also has functionalities of creating documents for the group. However, facebook chat is not quite reliable as a group chat and it does not support voice. [It reminds me of good old yahoo chat days. :) ] Document creation feature is in no way an alternative to attachments and code sharing. So, the next step was to create a mailing list.

With a mailing list, now we can have interleaved replies, no need to refer to the line we are replying to. Moreover, with a mailing list we can share documents easily as attachments and everyone can look into the other's progress at his/her convenience. For group chat, we started an IRC channel on freenode and used skype for voice chat in group.

Now, we were all set for discussing any ideas we had at any time. We only lacked in a tool for sharing code efficiently. We opted for a code hosting site. I preferred a distributed version control system over a centralised one because we expect a lot of code merges. Moreover, due to fluctuating internet, having the ability to commit locally would be an advantage. So, we opted for mercurial(hg) hosting at www.bitbucket.org. Mercurial is a mature distributed version control system and bitbucket has a feature rich user interface. Now, we are all set for the project and hope it turns successful.