Tuesday, May 08, 2012

Design of Web Service Vs Performance of Client

Long back, I was working on a desktop application which handles lots of data. That application connects to a web service to get the data. Once the data is downloaded, the user works on the data offline, and then uploads the updated data.

One fine day, I got a mail from the web service team that, I was using one web service call which gets the data for all the entities in a given component. They were planning to remove that web service, and asked to me to use two other web service calls. First web service gets me the ids of all the entities in the given component, and the second web service gets me the data for a given entity. So, I need to call the first web service and gets the ids of all the entities, and for each id, I need to call the second web service to get the data. If there are 100 entities in the component, then there would be 101 web service calls. The reason that they gave for this change was, the web service was taking lot of time, and taking lock on SQL Server for a long time, which is blocking other transactions.

As usual, I did not agree with their proposal. My arguments were,
  • There will be too many web service calls from the client to the server. Performance of the client would go down.
  • The performance of the server also would go down. If they have single stored procedure/web service, the server would do much less work than 100 web service calls/stored procedures.
  • If they are worried about SQL Server taking locks, they can have another wrapper web service which does all this work, and send it to the client, so that, client does not need to worry about the changes in the server.
Their arguments were,
  • The stored procedure for the original web service is very expensive, and taking huge time to execute. Till then, it is holding the lock and other transactions are blocked till that time.
  • Eventhough, with the proposed changes, the performance of this operation would go down, but, overall performance would increase, because, other transactions would not be blocked for a long time.
  • All the web service calls map to a stored procedure in the DB. Creating another web service which does not have any corresponding stored procedure does not look good. This would be the only web service call that would be odd, and they do not want to pollute the web service.

Till, I was in that project, I have not done what they had asked. I don't know what happened, after I moved out of that project.

Who is wrong in this case?

[Of course, even if you say that, I am wrong, I may not accept. Because, I still feel that, Webservice should be driven by the requirements of the user rather than the DB design.]

Wednesday, May 02, 2012

Discrimination Based on Sex, Caste and Religion

Two people (one guy and one girl) contact me once in a while, for any help required in their application.

Whenever the girl asks for help, it is done in 5 mins to 5 hours. Only once, it went beyond that.
Whenever the guy asks for help, it is done in 5 days to 5 weeks. Only once, it is done in less than 5 days.
Nobody has criticized me directly on this. But, it is quite possible that, they think, I am discriminating based on sex. 

Whenever the girl sends me an email for any help, she puts the entire information that she has in the email. If the information is huge, she dumps everything in a document and attaches that document.

Whenever the guy sends me an email for help, he puts enough information required for any user of that application. He does not put any redundant information and does not attach any extra documents so easily.

If I have any follow up questions, both would respond within one working hour.

In general, if there is any attachment, generally, I won't open it immediately. I would open it later, whenever I am free. Even by this logic, I should be more responsive to the guy rather than the girl.

Unfortunately, people underestimate/ignore many many small things which can change everything. The small things matter a lot in the real world, and if everybody concentrates only big things, we can never develop.

I am very lazy and busy. I am neither a user nor a developer of that application and I don't know the technology that is used in that application. It is developed by a less qualified person, and I am just maintaining it. If I want to do even small change in that, I have to spend lot of time for that. In such a situation, whoever is asking for help, I would be happy to get as much data as possible. When the guy sends the information, he sends enough information for the user of that application. But, I am not a user. So, I need more details. I had to follow up with that guy multiple times.

How exactly one can go to the screen that he is referring? Once I reach that screen, which user should I chose to test? What all operations can I perform on that application so that, their data is not modified? These are all obvious for any user of that application, but not for me. So, I had to follow up for each of those things one by one, because, I discover the second one only after the first is clarified. I generally work on these things at night or weekend, and he won't be available immediately to answer at that time. So, I get the response next working day. Each follow up would increase the time significantly. The general tendency is, if I had to spend more time and follow up many times, then I would delay it more. For example, if I followed up for four times, for first follow up, I may reply in one day, whereas for the fourth follow up, I may reply only after a week.

Once that task is done, after few days, he asked me to do some other change at some other place. By then, he deleted the test user. So, I had to follow up again to create the test user. After doing that, then he said, the same thing has to be done at other places. If he gives the entire information with detailed steps on everything, and asks me to solve it, then, I can spend least amount of time and get it done.

First time, when the girl sent me a big attachment with so much information, I got bewildered. But, when I started doing that, I never needed anything extra, and in one single sitting, I finished everything that she asked. Even for small things like, application is down, she sends full error message that she gets, eventhough, I could find it myself. That would save me few seconds, and I can directly login/open appropriate application/server to fix the issue.

Whenever she sends any mail to me, she does everything she could do, and spends a lot of time in composing the mail with all the information. She communicates to me in such a way that, my time is very valuable, and she tries to use minimum time of mine. Whereas, it is the exact opposite with that guy.

I respond faster to those who give more value to me and my time. I also expect, if they want to solve their problems, they should have more interest in solving their problems than me. Otherwise, I won't respond that much faster.

In towns and villages, many times, people of different castes talk in different ways with others. Few caste people may talk to others always in singular, and few other caste people talk to others always in plural. If somebody asks me a favor without giving respect, I would show minimum interest in solving his/her problem. But, if they give minimum respect, then I may spend time to solve their problems. If only one particular caste people give me respect, then it would look like, I discriminate based on caste, and help only that particular caste people.

I discriminate based on how much the other person values me and my time. If only particular sex, caste and religion people values me and my time, then one can assume that, I discriminate based on sex, caste and religion.

Monday, April 30, 2012

Over Qualified, Under Employment and Bad Work Do Not Exist

Many years back, at the beginning of my career, I was talking to my colleague, New Melchizedec. He told me that, for him, Salary matters more than the kind of work. I asked him, whether he would do a job which can be done even by a 10th class student. He said, he would definitely do it, but, not like a 10th class student, but like a computer science graduate.

It took me many years to understand what he meant. After understanding it, now, if anyone does not follow this, I won't be happy in taking that person to my team.

Many employees ask their company to provide good work. But, the company hired them to solve it's problems and not to provide good work. It is completely upto the employees to solve the problems either with good work or bad work.

Once, an acquaintance of mine called me for some small help. He wanted to download many files from a website. At that time, he could not find anyone else to do this bad work. So, he called me. He told me this, and went out and returned after few mins. Then, he told me that, he would start downloading the files from the bottom, and asked me to start downloading the files from the top. I told him, I had already written a script, and the files are getting downloaded. And we just did gossip till the download was over. He was very happy for that, because, last time, he and three more people had to spend few hours in downloading it. Now, I did not spend more than few mins.

If he gets another bad work, and if he has opportunity to call either a highly qualified person or less qualified person, I am sure, he would directly call the highly qualified person to do that bad work. The expectation is, the work would be done in very efficient way. If the highly qualified person thinks that, he is under utilized, nobody can help him.

The employer wants the problem to be solved. The employer may also give some method of solving the problem. It is upto the employee, whether to use that method or any random method to solve the problem and criticizing the employer for not giving good work, or using the most efficient method, and let others call that as good work.

Another example

I have seen an application, which is developed in a technology in which I cannot write anything other than "Hello World" program. That has just five pages with some data storage. In general, highly qualified people are not interested in doing the application with just five pages. So, it was given to a normal developer. After developing that application, the developer moved out, and I was given the control of the server which hosts that application to maintain it. That's when, the real problems started.

The application is developed in such a way that, it cannot be taken out and host it on a different server. They hard coded and assumed the OS, Path on the disk, path in the URL and everything else. The only way for me to deploy a new version of that, without touching any code is, buying a new server and installing the same OS and deploying in that. Nobody would sponsor a new server, just to deploy such a small application.

So, there is no backup. So, if there is any issue, I have to directly work on the production server and fix it. Since, it is production server, I cannot debug so easily. Since, it is production server, I cannot give control to others. So, I cannot take help from others, unless they are going to sit next to me and help me in that. There are so many issues like this.

If the same work is given to a highly qualified person, and that person develops the same application like how a highly qualified person develops rather than a less qualified person, then I would not have faced so many problems in maintaining it.

Many highly qualified people forget that, when they are given work of less complexity, the work is supposed to be done the way highly qualified people do rather than the way less qualified people do. Everybody should do the work in such a way that, no less qualified person can get the same quality. Otherwise, there is no use of hiring that person. We can hire a less qualified person with lesser pay.

I feel, the most under employed job is, taking care of children.

Wednesday, April 25, 2012

Not Giving Control in the Name of Improving Efficiency

The following is the notice that is sent to all the heads of the business units in a company.

We are changing the process of purchasing the hardware in our company. Till now, all the business unit heads are buying the hardware for the needs of their business units. Going forward, the entire hardware would be bought by the IT department. Business Units Heads will have to raise a request through IT department. IT department analyzes the request, and buys the most efficient hardware which satisfies the business requirements and reduces the cost for us. This is to improve our efficiency and reduce the costs.


Director of one business unit wants to buy a powerful server which costs around $100,000. He has a budget of $10,000,000 to run his business operations. According to the new rule, the hardware purchase has to be approved by the IT department. For that purpose, he meets the Director of the IT department.

Director of Business Unit: I would like to purchase one powerful server that costs around $100,000 for processing of some huge data.

IT Head: Why do you need that much powerful server? Why cannot you use normal computer for the same? If you need more CPU power, then use multiple computers.

DIR: We get huge data every month, and we would like to get the analysis results as soon as possible to take better decisions sooner. The application that we have does not support parallelizing. So, we need powerful server.

IT: Then, ask the application vendor to add support for parallelization.

DIR: They may ask $500,000 to support parallelization.

IT: That is your assumption. It should not be that expensive. If they write code in a clean way, then it should be straightforward to support parallelization. Raise a Request for Proposal (RFP) and ask them, how much they are going to quote for this. Or just do it yourself.

DIR: They write very clean code. That is not the issue. Since, they are product based, their cost is very high, and we are not allowed to change their code. If we raise RFP, that also would cost us minimum $25,000.

IT: Nobody asks money for RFP.

DIR: They don't ask money explicitly. But, they would add this expense in other items that we buy from them. Even if we get the parallelizing capacity, we will have to spend more time on our side to make sure that, the application is running in all the services, and restart it, if there is any failure. It requires me to allocate few people explicitly for this.

IT: Then, automate it. You don't need to go to that expensive company for automation. There are many other companies out there, which can automate these for very less cost.

DIR: Can you take care of the automation?

IT: No. We are too busy. We don't have enough bandwidth to do those. You will easily find plenty of companies which can do it for very less cost.

DIR: One of my team members assured me that, if I provide him this hardware and one day per month, he would provide me all the data that I need, in the least amount of time, without asking me anything else. If I have to go by your approach, then myself and my team members will have to spend lot of time in getting these things done.

IT: Initially yes. But, we would be saving lot of time in the long run.

Later, that director gave a contract to the original vendor, which developed the application. By that contract, the vendor would run the data analysis and give the analyzed results to this company. For this, the vendor would get $100,000 per quarter.

Inspired by a real story. There are many companies, which are surviving only because of these policies in big companies.

Sunday, April 22, 2012

Quote of the Day - Decision Power to Multiple People

The most easiest way to destroy a company/project is, instead of giving decision power and responsibility to a single person, ask them to take decisions by consensus and have collective responsibility.