Friday, August 21, 2009

Graph of diminishing questions

How do you feel if somebody asks too many questions?

Well, whenever we have a new team member joining our group – we all go through the same experience. I call it - graph of diminishing questions [as shown below]



We see one of the following reactions or some combination of it

1. why s/he is asking so many questions - come-on it’s a simple business application - and you are hired to work on it - go figure it out - we gave him / her access to all the systems, code, database - what more can we do - I mean put some break points - run some queries - go figure it out on your own - that’s why you are hired - don’t ask me all these stupid questions?

2. I am not sure why s/he is not asking any questions. If you don’t understand then just ask us. But please don’t say yes when you don’t get it. You know - just yesterday, I was at his/her desk, and by looking at the screen, I can tell you s/he is lost, I don’t think s/he knows anything about the system - and I am not sure why s/he is not asking any questions?

3. Well s/he is a smart person but I think – I don’t know - s/he might have over promised in the interview and now struggling - I think s/he is not that smart as was told to us [by somebody – may be our boss…]

4. We don’t do too much training here - we throw the baby in the water and if she can swim - she can stay

5. We do work with new people and explain them the system and also help them understand the real challenge

I can go on and on and on, but I guess the point is simple - what do you do? I am sure almost everybody wants to opt for no 5, but in reality we are somewhere between 1 and 4. Challenge is to change our culture and look back at our own experience, and remember the day when we were new. When everything looked like a big mystery and intimidating nightmare. We had no clue where to start and what to do. This will force us to help others in understanding the mess [sorry software] that we help [or were paid] to build...



Thursday, June 11, 2009

How many CPUs your operating system can handle?

How many CPUs your operating system can handle? 2 / 4 / 8 – many a times ans is very simple – I don’t know? How to find the answer? Here is one easy way to get to the bottom of this issue. Go to the Task Manager and right click on any process , and then click on the set affinity option as shown below. You will get the answer. Note: this is the number – how many CPUs can be managed by your OS and not the underlying hardware.






And here are the specs for a machine I used in this excercise


Sunday, May 3, 2009

Multiplexing strategy for reducing software licensing cost

Software licensing is a complex and confusing topic. Most of us know how to use and master any given software like SQL Server, Oracle, or Crystal Report etc. But purchasing a software and figuring out the real cost is a challenge. Questions like do you want to go with named-users or per core licensing or on the basis of number of processors or total number of CPU’s are confusing. For example, Microsoft will charge you based on the number of processors in your server irrespective of number of CPUs / core per processor and Oracle will treat each core as half the processor. For example, on 4 quad core server [4 processors with 4 CPUs on each processor = 16 CPUs or cores], SQL server will cost you for 4 licenses and Oracle will result in 8 licensees [16 * 0.5 =8] [1]

Now this might be acceptable for enterprise grade tools like RDBMS or reporting solution. But many a time we end up buying 8 or 10 copies of small commodity software used by a department or a group of users working on a special project. Most of these tools are sold on per instance basis. So we end up paying for 10 copies and installing it on individual desktops. This also results in maintenance nightmare.

There is a better way to deal with such commodity tools – strategy known as multiplexing. It’s very straight forward – all you have to do is to install one instance of the commodity software on your central server and write a wrapper around it. The wrapper can be exposed over the network [LAN / WAN / Internet] using http, https etc. Yes, you will have to write a web application that will expose the interface for the commodity tool. Many a times, this strategy will work like a charm [except if licensing agreement for the commodity tool explicitly deny the permission for any such exercise]. Note – this does not involve changing any of the bits / code in the commodity software – all you are doing is to expose its public interface over the network. Threading and deadlocks might pose some challenge when shared resources are simultaneously utilized by many users. But this can be avoided by placing an explicit lock on shared resources like file folders. Additionally, this public interface can be modified to accept the inputs from internal resources like local databases, file system etc.

If used judiciously, multiplexing can deliver a great business value.

Reference:

1.http://www.microsoft.com/Sqlserver/2005/en/us/special-considerations.aspx

Monday, April 20, 2009

Web 2.0 and Cloud Computing

It is always good to compare different technologies. That way we can see whether the technology is maturing with time and is worth considering it for real. But the challenge is to find a tool that would help in this endeavor. I found “Gartner Hype Cycle” [GHC] really effective in comparing different technologies and their evolution.

So I wanted to see how web 2.0 is doing over last three years and where does cloud computing stand on this technology curve. I always believed that image is worth thousand blogs…so here you go – GHC for 2006, 07 and 2008 and the evolution of web 2.0 vs. cloud computing. ..







Reference
for 2006
http://www.saastream.com/my_weblog/images/2007/10/02/gartner_hype_cycle_emerging_techn_4.jpg
for 2007
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKRtg86I2SFDcA_IyZK3lG8u5d7KOpX0eEQAaPqmLqlT7k9wLr61vlCbEYmruMdU__jyGJBIBN-scyV7gkIi21CZGD91Bzhlu2XlQ1LKZV58qpTUe39xP7PpJLC1RNEuayK-Latvy45mTF/s400/hype-cycle-for-emerging-technologies-2008-400.jpg
for 2008
http://www.flickr.com/photos/lafabriquedeblogs/2796357787/

Sunday, April 19, 2009

Virtualization : as experienced from ground zero

Virtualization is a big theme in the contemporary enterprise architecture. Many documented case studies highlights the virtualization benefits including better hardware utilization, grater ROI and lower TCO. This deal is so great that you can’t overlook this option…




But, and this but is a big one. But the reality is not that green. From software point of view, it is not able to utilize 100% of the physical infrastructure. Like in our example, we have 8 CPUs and 128 GB of RAM, but each virtual machine can only use up to 4 CPUs and 64 GB of RAM. Systems like RDBMS thrive in many-core / multi-processor environment. So by limiting the number of CPUs or memory, we are minimizing its capacity. This is what we experienced when we decided to use a hypervisor [and this is mostly true for any hypervisor].

In future version of hypervisors, this limitation will be fixed. Based on the processing load, each VM will be able to optimize the physical resource utilization. But as of today, there are some hard limits on no of CPUs and RAM each VM can use.

So to conclude, in our test case – let’s compare machine A with 8 CPUs and 16 GB of RAM with machine B with 8 CPUs and 128 GB of RAM. Machine B is virtualized and is used to run 2 VMs with 4 CPUs each and 64 GB of RAM. Both the VM’s on machine B are operating in parallel and are used for running an instance of SQL Server 2005 and a file server. Which SQL Server instance will run fast – one that is running on machine A or on machine B? What if we bump up the RAM in machine B up to 256 GB? These are some solid question one should consider seriously before jumping on the virtualization bandwagon. Yes, all these issues will be fixed in the future versions and all vendors are working on it. But from pure architecture point of view, as of today, one should consider these limitations seriously.

A lot will depend on the processing load and type of applications running on these virtual machines. For busts and spikes – you need a ton load of RAM and huge processing for a while but after that all that capacity is just idling around. What if that bust or spike is the reason for provisioning such a huge hardware capacity? Can we run this busty system in a virtualized environment and let it suffer because of VM’s limit on no of CPU it can handle and maximize our hardware utilization or go the traditional way and provision a big machine just to handle this one mission critical load efficiently and effectively? These are some critical questions one would face while moving the production applications in a virtualized environment. There are no easy answers and the only way to insure the success is by doing as much testing as possible.

Sunday, February 1, 2009

On the Benefits of Learning Multiple Languages

Finally, I got to the pile of magazines I wanted to read for long time. I found this article in Visual Studio magazine. I liked the title and started reading it. The basic premise is – “Learning other programming languages can make you more fluent and give you a better understanding of the language you depend on primarily.”

So I started coding in the language I know the best – C# and wrote some code


using System;

namespace demo
{
internal class Test
{
public static void Main()
{
const int i = 2;

//static method call
Console.WriteLine(IsEven(i));

//generic delegate
Func<int, bool> f = IsEven;
Console.WriteLine(f(2));

//anonmous method + lambda
Func<int, bool> f1 = j => j%2 == 0;
Console.WriteLine(f1(2));

Console.ReadLine();
}

public static bool IsEven(int number)
{
return number > 0 ? number%2 == 0 : false;
}
}
}

Now, I wanted to convert this code to visual basic. Interestingly, I found a decent conversion method to get this thing done. I used .NET reflector. I used reflector to disassemble C# .exe and then to convert the code to VB. Reflector did a good job and produced following VB code


Friend Class Test
' Methods
Public Shared Function IsEven(ByVal number As Integer) As Boolean
Return IIf((number > 0), ((number Mod 2) = 0), False)
End Function

Public Shared Sub Main()
Console.WriteLine(Test.IsEven(2))
Dim f As Func(Of Integer, Boolean) = New Func(Of Integer, Boolean)(AddressOf Test.IsEven)
Console.WriteLine(f.Invoke(2))
Dim f1 As Func(Of Integer, Boolean) = j => ((j Mod 2) = 0)
Console.WriteLine(f1.Invoke(2))
Console.ReadLine
End Sub

End Class

The only point it tripped is on the lambda expression syntax =>. So, I had to do a little bit of Googling to find the correct VB syntax. And, finally got the VB code like


Friend Class Test
' Methods
Public Shared Function IsEven(ByVal number As Integer) As Boolean
Return IIf((number > 0), ((number Mod 2) = 0), False)
End Function

Public Shared Sub Main()

Console.WriteLine(IsEven(2))
Dim f As Func(Of Integer, Boolean) = New Func(Of Integer, Boolean)(AddressOf IsEven)
Console.WriteLine(f.Invoke(2))
Dim f1 As Func(Of Integer, Boolean) = Function(j) j Mod 2 = 0
Console.WriteLine(f1.Invoke(3))
Console.ReadLine()

End Sub
End Class

I enjoyed this exercise. In fact, in the same edition of the VS magazine, I found couple of interesting articles - What VB Devs Should Know About C# and What C# Devs Should Know About VB.

If you are involved in any migration effort from VB to C# or vice versa, or work in the mix environment with a lot of VB and C# code co-existing peacefully , then you will find these articles really useful.

Sunday, November 2, 2008

Towards Distributed Applications…

2008 is the year when we saw the commercial emergence of the many-core / multi -core hardware architecture. As a result of this, field of distributed computing is really buzzing with a lot of activities and cool technologies. Two such projects that attracted my attention are project Volta and DryadLINQ in Microsoft domain and Lively Kernel in the Java world. Let’s focus on Dryad and Volta first.

One common thing about Volta and DryadLINQ is that they focus on making distributed computing easy for the common programmer like me. [DryadLINQ documentation refers to this class of programmers as ordinary programmer – LOL!] . The strategy here is to abstract away the underlying complexity in building the distributed systems and to minimize the disruptive impact of the new technology.


This goal is achieved by focusing on different levels of the .NET implementation stack. This way, as a developer, I can still write my same old C# / VB sequential, LOB code and the technology will transform it into a distributed application.

As with any new technology, there will be few bumps on the road. At the time of writing this post, I found following message on the Volta site –

“Project "Volta" Temporarily Unavailable”

Good news is that big vendors like Microsoft and Sun are taking the bull by the horns. There is no one right answer in solving this complex problem of converting existing sequential , single processor LOB applications into multi-core/ many-core enabled , inherently parallel, distributed applications. We will witness multitude of solutions on hardware and software level. We have seen this gold rush before in the good old days of RDBMS emergence. Let’s hope that same thing will happen with the distributed computing infrastructure.

For more details on Volta and Dryad, check out the following links and publication

1.http://channel9.msdn.com/posts/Charles/Erik-Meijer-Volta-Wrapping-the-Cloud-with-NET-Part-1

2.Volta: Developing Distributed Applications by Recompiling, IEEE Software Sept/Oct 2008 issue

3.http://research.microsoft.com/research/sv/dryad/