Friday, August 28, 2009

I am glad BJP lost

Because if they don't know how to run a party then how could they have run a country? This party has to reinvent itself. I see a new opposition emerging by next elections most probably under Nitish Kumar with these breakaway BJP liberals. Under Advani and Rajnath BJP has dragged itself back to its dark ages. Except once I have always voted for BJP but I won't even go near them in what they are today. Even Mayawati knows how to run a political party than these guys do. This lauh purush is a joke. He is a living example of age should not be a criteria of leadership. He rode on Vajpayee's charisma and conveniently projected himself as his heir when he has never been able to prove his administrative abilities. What a disaster he has been for BJP. If RSS can't find BJP a new set of leadership who are genuinely rooted in its beliefs then they are better off gone. Sonia Gandhi who was targeted by this party with a difference on being naive, a foreigner, a dumb and what not has kicked their butt for a second time in a row. Leaders prove their mettle by demonstrating results not by some BS talk. Their loss has indeed saved India.

Tuesday, August 25, 2009

Blaming the heroes

India is in a row over Jaswant Singh's book on Jinnah, the founding leader of Pakistan. He praised him for his secular credentials that later got a supportive argument from K Sundarshan, the retired RSS chief himself. While BJP battles internal unrest bitten by two consecutive defeats in national polls, this new political upheavel becomes important. First, it came out of BJP a political avatar of Hindu Mahasabha that has its roots planted in denial of two nation theory that many blame Jinnah for. Second the leaders who said and gave support to this argument have been associated with BJP for more than a few decades. This episode is also important as it challenges the history that is being taught in schools at both sides of the border. Today as we see it, probably partition was a good thing at least for India. The cancer that has spread across the world emanating from a region of Pakistan, even though has victimized India but not to an extent that it would have been if India and Pakistan were a one big nation. It is also unfortunate that heroes are judged on the decisions they made generations ago. Maturity of a nation is when it knows, admits and corrects the blunders of leaders of past and moves on. As it turns out Jinnah changed himself to what he was not and never believed in, because of indifferent attitude of some of the leaders of the then freedom movement. While Gandhi saw an opportunity in garnering support of Muslims for freedom from British rule in Caliphet movement of Turkey, Jinnah took a more pragmatic approach and opposed it on the grounds of no association of Caliphas with Indian muslims. It was not because he wanted the British rule but because it had no Indian roots in it. This position should be saluted. Personalities collided and decisions were made based on egos. As much one theory failed the other succeeded but neither of the two sides of leaders were responsible for either its successes or failures. Decision to not buy an umbrella because it did not rain can not be used as an argument to prove of one being a visionary. Every human has a Ram and a Ravana inside him, but he is judged based on when he brings out who. While Jinnah was a hurt soul, Nehru a stubborn visionary, Patel had to save what was to be left. They all had to play a role in history and they did for never to be forgotten. Now what? Pakistan is a reality and India is a reality only the truth is not real. It is time to move on as the past fades away in oblivion.

Friday, August 21, 2009

Don't dare to call it a clunker

Almost everyone remembers his or her first car. The car we buy right after learning how to drive. In most cases with our own money. The car that we loved to sneak a peek of late nights when we pretended not to be asleep just to have a reason to go and look at it. The car we took to drive our loved ones around. The car we washed with our own hands and loved to do so. A vehicle that drove us to school or our first job or to your first girlfriends house. The car that made us proud when there was nothing else that did. A dent on it was a dent on your heart. The car that you thought you will pass it on to your grand kids. Yes the car that couldn't keep up with the greed of oil companies. The car that started to cough as if it aged with me. Yes the car that I poured my dreams into. Don't dare to call it a clunker.

Pushing changed data to Coherence

Problem Statement - How to capture data changed in an external data source and invalidate the Cache?
I attended a customer call where we discussed this same problem and I think I could be more explanatory in a blog than on a call. Before we consider any solution one thing that must be known is that Coherence is a data source. Not a relational data source, not like a directory interface but it is a data source - of a different kind. So the problem now becomes more generic - how do we synchronize two discrete data sources? The solution will revolve around similar solutions as if you synchronize an LDAP with a relational database. Have you done that?
Following are the four architectural line of attacks that can be taken. Depending on how stale-data can an application deal with, a few or none of these solutions may or may not work. So make your own judicious decision.

  • Invalidate the data with in.
  • Source of data change propagates the change.
  • Let an external mechanism do it.
  • Whoever changed the database should also change the Cache.
Invalidating the Cache Entries With In
  • [Time to live] Coherence Cache entries have a time to live attribute. TTL defines how long an Entry should live in the cache. Based on data access frequency and expected cache hits an appropriate expiration time can be set. If over an hour period 90% of cache hits are expected to take place in first 15 mins of entry being put and are less frequently later on then a ttl of 15mins gives you a good invalidation parameter. A typical use case is load the data, process it and invalidate it as soon as it is done. This can be helpful if the same entry is being accessed multiple times during the processing.
  • [Refresh Ahead Factor] This is based on a wonderful analogy of serving fries in McDonald's. If we ask for fries that are about to be over then we get the last pieces but it triggers an asynchronous load of fries from an oven. An appropriate refresh-ahead-factor can be set in the cache configuration that will trigger an asynchronous Cache Load operation (using a CacheLoader component - must have a read-through pattern) if data are accessed after the second half of this factor of expiration. So if data changed in an external data source it will be refreshed in the Cache and next access gets the latest. The refresh ahead assumes a continuous stream of data access while lesser database (or any external data sources) updates behind the scene.
Propagation by data source where changed occurred
  • If you are already on Oracle 11g a DCN mechanism can be used where applications can directly register with the database for change-events. After receiving the change-events the application can then propagate the changes to Coherence.
  • Responsibility of change event propagation lies with the owner where change occurred.
An External Agent
  • Oracle Data Integrator has a Changed Data Capture feature that can be used to push changes from a data base to Coherence.
  • Or a simple DB Adapter. An external application polls for data changes at a regular frequency, captures the changed data set and propagates the changes to Coherence cache.
  • Oracle's BPEL PM has an inbuilt DBAdapter that can propagate the change to Coherence using an embedded Java Activity.
  • Simple and could be light weight. Polling could be heavy and needs to be considered when provisioning database loads.
After all, you did it
  • Coherence supports three heterogenous platform - Java, C++ and .NET. It is very likely that application that changed the data in an external data source is running on one of these three platforms. Application that changed data in the database can be extended to propagate the same changes to Coherence as well. Transactional successes should be considered to avoid data being propagated in Cache but didn't succeed in database.
  • ORM like Toplink has SessionEventListener that can retrieve changed data set upon a database commit and this SessionEventListener can propagate the changes to Coherence cache(s).

Saturday, August 08, 2009

एक और शेर

पतंगें उड़े हवाओं में मेरे यादों की तरह से,
डोर देकर मेरे हाथों में, कि मैं भूलूँ न उसे।
रंग तो साथ ले जायें कोसों दूर आसमानों में,
उँगलियों में बाँध जायें बस काटने को मंझे।
बचाने उसे भागूँ मैं इधर दौड़ के पछाड़ के,
कि उतार लुंगा उसे शाम होते ही इस भरोसे।