Showing posts with label Elastic Cloud Computing. Show all posts
Showing posts with label Elastic Cloud Computing. Show all posts

Monday, March 28, 2011

Weekly Diary of a Rails Developer

Day 1
Ruby on Rails Installtion

Rails installation and configuration
Installing rvm for ruby versions on same system.
Installing dependencies for rails,rvm and gems like iconv,mysql,hpricot,sqlite,nokogiri etc by using apt-get.
Solving issues found during installation.


Day 2
Model (ActiveRecord )

Using validations like validates_presence_of, validates_uniqueness_of, validates_size_of,validates_format_of etc.
Using association for specifying relationships in the tables using has_one,has_many, belongs_to etc.
Using named_scope to classify and access records. Include and joins are used to access data from tables and query data.

Day 3
View ( ActionView )

Using views in html and haml files.
Using haml with right indentation are important as the ending tag depends on this.
Including javascript/stylesheets in views by using the include and link tag respectively.
Using different types of ajax tags like link_to_function,form_remote_tag etc which is used to harness the power of javascript library.
Using Partials we can have the same view has to retained on multiple pages. The layout file is used to specify the background of the page which is made to be used for multiple pages or for just single pages by mentioning it on the controller as layout "filename".
Using Yield to insert contents on a particular layout.
Using Render to show the same page again with the parameters already present in the response while redirect is used to tranfer the response to a different function and then to a different view.

Day 4
Controller ( ActionController )

Using facility within the application that directs traffic, on the one hand querying the models for specific data, and on the other hand organizing that data (searching, sorting, massaging it) into a form that fits the needs of a given view.
Managing the layout in application that is to be used for the views from that controller.
Using access specifiers like public,private for methods on the controller.
Using filters on controller like before_filter and callbacks which are like after_create, before_save, after_save etc.

Day 5
Migration Scripts

Creating Rails migrations for creating tables , manipulating columns in it.
For specifying its data structure.
Creating up and down blocks for it.
Specific migration can be run and it can also be reverted using different migration command.
Migration files are created when a model is created also additional migration files can be created for inserting columns to table later on.

All Days
Working on git, gems

Using git for version management.
Creating account on git, uploading private keys on it,
Using git for cloning code from origin, making git repository,creating new branches, merging branches with master, pulling and pushing code from origin and to origin.
Using gems for additional features e.g.
seed_fu,
paperclip,
s3,
authologic,
facebooker,
twitteroauth,
fckeditor,
act_as_ferret,
will_paginate,
rmagick,
etc..
Using bundler and Maintaining differnt section in gemfile for development,production and testing.

On Weekend :)
Deploying App on Cloud (Heroku)

Using heroku for deploying application.
Creating application according to the heroku requiremeent as on heroku we have time limit for request and response.
Using amazon s3 for storing files as Heroku does not file storage on it. Creating rake tasks for that.
Using gems which supports heroku.
Using heroku commands,
e.g heroku logs, heroku rake etc.


Philosphy that Developer lives everyday
TDD(Test Driven Developement), DRY ( Do Not Repeat Yourself)

Saturday, May 23, 2009

Evaluating Amazon EC2 for a new startup

Recently I got involved in shaping up a new job portal site. While architecting the application I was sure that it will be best to go for Amazon S3(Simple Storage Service) for storing my unstructured data in forms of pdf, word-docs, ppts. When I started thinking upon deployment options I started digging into Amazon EC2 . This was some interesting thing that I want share about..
We were very clear about our plan. The steps till final release we defined were 1) nightly build release 2) alpha release 3) beta release

Nightly build release is just for developers and testers. alpha release is going to be accessed by some real market users ( a trial access invitations being sent to few top recruiters in US market) and once its accepted by industry then beta release with some marketing. Plan was to have 500 odd recruiters and 5000~6000 candidates in first 3~4 months, which was very modest. But We wanted to keep the application scalable and our deployment architecture such that we can go and keep adding city after city ..Boston..Chicago..NewYork..and so on.. the way craigslist done !

After so much of buzz of "cloud computing" , adding up of Elastic term by Amazon I seriously started looking for it.. claims are really promising.. you are paying only for what you are using and you can scale it factor-n without any hassle and very rapidly.

Big question for us was whether to go for EC2 service from day one? Will it be cost effective from day one?

I started searching answer for these questions.. I revisited pricing of Amazon EC2.

The pricing below is based on data transferred "in" and "out" of Amazon EC2.

Data Transfer In
All Data Transfer $0.10 per GB

So I am going to pay $0.10 for every GB starting from my first byte. When I requested for some quotes from hosting service provider for dedicated server , I got response with quotes ranging from 5$ to 75$ per month with 1500 GB bandwidth included.
It was appearant that if my bandwidth usage is going to be above 500 GB but below 1500 GB then dedicated server is the best bargain for me.. but the day I start consuming more than 1500 GB bandwidth amazon Ec2 would turn me cheaper and also very scalable solution..

Decision was obvious start with a dedicated server and switch to EC2 when you are real candidate for it.. when you really are a growing and scaling application.

So take a pill only when you require it and if you require it :)