Showing posts with label paidinterviews. Show all posts
Showing posts with label paidinterviews. Show all posts

Thursday, October 2, 2008

Post Production Stress

Two weeks before we went live with one of our products. A product where I worked personally for 4 months. I still do not feel I did justice to the product as the actual problems still glare at me when I see the application. It was a whole lot of work within 4 months and a more work when it went live. As the product was the first one to go live from us, we where a little tense. Some glitches here and there and I was all stressed out.

Its a whole big deal making an application live or into production. Especially if the application is not owned completely by you. The task of closely monitoring it, making sure that nothing breaks, maintaining the backups, ensuring that binding is done quickly and effectively if something breaks is completely done by the team. This is very tense. And I deeply appreciate all those managers who sympathize and stay beside their team during those stressful times. If you are answerable then you better have pretty good answers.

The build technique that was made is my main area of concentration this time around. Indraneel was the person in charge and I sat with him one time to deploy the code live. The scripts written via capistrano were excellent. The deployment can be to the test server or the live server. This requires issuing of different commands and writing separate tasks. The commands issued are remote commands and they usually are stop and start commands for mongrel. This application had also ap4r in it for asynchronous processing and therefore required a restart for that as well.

Monit has also been installed in this server and ap4r and mongrel has been configured to restart once stopped. The mod proxy balancer has been put along with apache so that mongrel clustering can be implemented. The balancer member written inside the proxy tags has an ip associated to it. This is where the actual transition in case of updates for the live application comes into picture. Using apache we could have something called a graceful restart using the 'apachectl graceful' command. Normally when a new code is deployed with all those changes and upgrades the server (mongrel in this case) must be restarted. But with graceful restart Indraneel just has to do minimal stuff. He first deploys the new code onto a server started with a different port, say mirror. Now what he does is change the balancer member port number to the mirror port and does a graceful restart. And wallah .. a work well done. This could also be automated if there were 2 virtual host files and according to the live/mirror deployment, the file is overwritten by the specific files.

Great work !!

Wednesday, June 4, 2008

Iteration's Over

4 days of mayhem. Sleepless nights and total work. Now I understand what a 'working professional' feels like. Most of the problems where HTML based. We, me and Amit, did all we could, from fixing HTML to Functional and Unit testing. Even after having worked so hard, we got errors during the demo. These errors were quickly sorted out, but pressurized us. But all that is well, ends well (I am a pessimist by the way).

Ruby On Rails coding has been great up until now. Yesterday I had a party along with Vivek, Rohan, Abhilash, Abhijat and Amit, and then Vivek told me the problem he faced when a query fired via find_by_sql took 5 secs to execute. He tells that the query is a simple one with a where clause, no 'in' statements, but fetches 20000 odd records. The same query run via php-myadmin runs in .00x odd secs. Is the Active Record a bad ORM then? I also find many people stating that not using the Active Record in Rails will solve a whole lot of problems.

It was also interesting to find that the ':include' option in 'find' will return you the object to which it has Foreign Key - Primary Key relationship. But it doesnot work if there is a select clause. But why ? If i have a credit table and a user table, then I cant write a find statement, with :include, which gives me the credit amount and the user data? It is a join at the end of the day and the populated stuff, which I understand is bad, could be populated along with the user hash too. This is also the case if I iterate through an array with records which were fetched with along with a select statement. Could not decide if this were logical.

We also put some validations along with the code. Live Validation was introduced to me for the first time and I loved it. I also understand there is a RoR plug-in for this which directly hooks up to the model and then writes its own Javascript code according to the validations given at the model level. Thats just 'WOW' !

I out of ideas as it has been a long time now that I have written something.

But as Arnie says 'I'll Be Back !'