Wednesday, January 26, 2011

Main thak chuka hu



Ek din bheed mein chalte chalte achanak yeh mehsus hua ki main bhi bheed ka ek hissa ban chuka hu. Bachpan mein jo lagta tha ki main dusro se alag hu, main zindagi mein kuch alag karke dikhaunga, aaj sab jhooth lagta hai. Aaj lagta hai ki main bhi un hazaaro laakhon logon ki hi tarah maamooli hu. Maine kuch bada kaam kiya nahi hai aur aisa lagta hai ki shayad kar bhi nahi paaunga. Kayi sapne tut ke choor ho gaye hai aur jo bache hai who aaj bhi adhoore hai. Aur najaane kyu mann mein kahi yeh darr hai ki yeh saare sapne kabhi poore nahi honge. Unko poori karne ki yeh jo bhaag daud hai who najaane kyu aaj bematlab si lag rahi hai. Thak chuka hu main sabko jawaab dete dete, thak chukka hu main sabko samjhate samjhate. Aur sabse jyada main apne aap ko samjhake thak gaya hu. Ab aur naahi himaat hai, naahi hausla hai, aur naahi taakat hai ki main iss duniya se ladhu, main apne aap se ladhu. Main thak chuka hu.

Wednesday, January 05, 2011

Referential integrity of an entity called life

Referential integrity is needed to keep the entity as a particular and the database as a whole in synchronized state. If a primary key value of a particular table is deleted or tampered with, either the corresponding key value of the foreign table should be deleted (known as cascade) or a message should be generated and the delete operation should be stopped. If none of these steps are carried out, the database goes for a toss rendering itself completely useless.

Sounds as a simple rule in databases, right? But when applied to a larger entity called ‘life’, the database definitions start getting more complex. A column which is the primary key of a given table has necessarily undergone the polling session when it was appointed as the primary key of that table at the first place. So, that means everyone (including the table and the key selected to be the primary key) knows its importance in the bigger role and the bigger world. All the further transactions and definitions of some of the larger database tables, now depend on the definition of this table. Various static and dynamic definitions are executed and various objects are created and altered accordingly in order to fit the integrity of this entity into the whole database. There are many new entities (smaller as well as larger, some even as critical as life itself) based on the current definition of this entity.

But, when this key in being deleted (for whatever reason) from the entity, referential integrity rule should, ideally, be applied right? That means, even the other primary key values should be deleted (in a cascaded manner) or a (strict) message should be displayed that this delete operation cannot (could not is too lenient a term for database errors ) be performed. But this does not happen and the key is deleted without taking into consideration any warnings or messages or even the possible threat of a complete database crash. This ultimately results in a complete disaster leaving the database in a totally unsynchronized manner and sometimes even crashes it rendering it completely useless. Only use of this database, then would be to query junk and some reference data.

Thus it is vividly clear that even though referential integrity is a small and simple concept in databases but when it comes to a larger entity called life, it is not that simple as we/people think.