Sunday, May 24, 2009

Yes Deletion is not write behind

There are a few critical words that Coherence or any similar distributed mechanisms are built around. Coherency, Consistency and Availability are a few. In a room if you ask a question to anyone about something and irrespective of who you ask you get the same reply we have a coherent system. They don't have to speak the truth but as long as they all tell the same answer it is a coherent system. Consistency is across the boundaries of a single data source. If the answer against a Coherence cluster is same as what say a relational database tells at a given time then these two systems are consistent systems. Availability is when applications have an ability to find the data irrespective of failures and unavailability. Coherence cache like any database supports Entry Insert, Update and Delete operations. While the Cache itself is coherent, Entry Insertion and Updates are about data availability while Delete is a peculiar use case and is about data consistency. Coherence write-behind is a mechanism that allows asynchronous/delayed persistence of changes in the Cache to an external data source like a Database. While inserts and updates can be delayed Entry deletion is not write-behind. Why?
Applications quite often confuse data eviction with data deletion. A poor analogy of eviction is like if someone moves from Phoenix, AZ to LA. If someone lives in Arizona and decides to leave it is similar to data eviction. Application looking at AZ data would not find him but there could be a way to find him if need be (barring a fact that its not the same object that lives at two places in real life but it does in two systems). Deletion is like that person dies. You cannot die in Arizona and live in Los Angeles. If thats the case probably LAPD has to get involved ;). Data deletion has to be conservative and needs to make sure it is consistent across all the data sources. This is why Coherence write-behind mechanism makes Entry deletion a synchronous process even if there is a delay set. The good thing is API contract is just to an extent of calling erase() method of the configured CacheStore. Even though not recommended but If your application mandates that all CRUD operations are of equal priority can be done by using some Timer service inside the erase () erase process still can offload the deletion steps to a separate thread that deletes data after a write-behind delay.

Sunday, May 17, 2009

इक शेर

आवाजें दूर की गुजरां करें मेरे कानो के साए से,
सुनाई कुछ भी ना दे बस जगाती हैं इक आहट सी।
पुकारें चुप सी रहती हैं लगे बहती आखों से किसी के,
बुलाते खींचते अपनी तरफ़, ये धागे गुम हवाओं सी।
कि आजा पास अब ये दूरियां नागवार होती हैं,
करें क्या? बंधीं हैं बेड़ियों सी नागिनें पैरों में चाहत सी।
कहाँ जायें किधर जायें किधर जायें कहाँ जायें?
ये राहें काटती पैरों को, बुला के पास काटों सी।

Friday, May 15, 2009

What BJP does not understand again and again

So it came out true what I had predicted - A win for UPA and rejection of Left and Third front. For BJP it must hurt with two consecutive defeats with people rejecting its leader and its policies. BJP and NDA will sure analyze what went wrong but it does not matter if they do not learn from it. They did not learn the last time either. If they want to get their acts together they have to go back and do major overhaul on what they actually stand for and how they see their future as. Following are simple reasons why BJP failed and is ironic why they couldn't see it.

  1. Personal attacks on leaders does not work. People have rejected it in the past and they will in the future.
  2. Indians have already accepted Sonia Gandhi as an Indian, projecting her as an outsider does not strike a cord with common masses.
  3. An absolute absence of young leaders in the age group of 35-45. A wave of Omar Abdullas, Sachin Pilots, Jyotir Adityas and Rahul Gandhis are coming to crush you.
  4. Absence of any credible presence in South or strong alliance. Banking on post-election alliances would not work.
  5. Retaining the states. They keep losing some key northern states. The states they have won is because how the state government has performed not because of Advani's appeal.
  6. L.K Advani is not an accepted leader of common Indians and he has been rejected in 2009 elections. Sooner he retires the better.
  7. Growth is what will bring them back. There has to be BJP in every state winning local elections. Grass root presence is key to revival.
  8. Up till 1991 BJP was seen as a party not hungry for power. If they have to win then do not project themselves as an alternative of Congress but a party that has concrete beliefs on issues.
  9. BJP is a company that can not build themselves by acquisitions (alliances) alone, they need to generate products.

A tale of two cell phones - why reliability is important

I loved my Palm Treo when I bought it. At that time iPhone was not available and getting a smart phone with a touch screen was all I wanted. And then I broke its screen (thanks for tossing a TV remote on the Bed). I was sad but resilient to fix it instead of buying a new one. Thanks to eBay bought a Palm touch screen and replaced it. While doing so I dropped its mic and for the sake of not taking any more risks I decided to buy a Bluetooth headset so I could continue using the phone. I so loved the phone that I also configured twitter with it. And then one day it decided to breach my trust and apathy. The phone decided to divorce the bluetooth headset. Even though there was a problem with the headset as well but even after getting a replacement it just did not work. I so wanted an iPhone. The price and thanks to the economy I decided to buy a $50 3G Samsung flip phone instead. Moving back to a non-touch-screen phone was hard. 3G was good but my current plan does not have an unrestricted data plan so watching ESPN on phone was not something that I could do. Good enough phone and except a few times going to Apple website to watch an iPhone I decided to settle down. It was like after a failed relationship while on the bounce unable to get any attention from that darn rich beauty deciding to get married to somebody else. The Samsung phone just worked with nice handy features. I stayed happy till the day when I needed reliability more than features. Had to be on a conference call all day for 12 hrs, I plugged the phone with a charger hoping the battery will remain available while I talk. No it did not. It failed the reliability test. The battery died in the middle while I was talking. The charger should have worked while the phone was busy, or at least that what I assumed. Then my old Palm saved the day. Flipped the SIM hooked a cheap Walmart wired headset and I was ready to go. The best thing while I talked, the phone charger continued to charge the battery and for the entire session the battery signal remained green. Features, bluetooth, touch screen was not on my mind. When it comes to saving the day its the battery that matters.

Wednesday, May 06, 2009

Mac Ad

It took humans thousands of years to Mechanize.. Isn't it time to Mac-anize?