database_down Believe me there are people who don’t want the database to work. There can be many reasons for example like getting forced job security by being the only one who can handle the database or may be they hate the current project and want to fail it. Obviously they can’t oppose the company downfall clearly or else there is no reason for you to fire them so they have better plans. They can kill the database silently and apply these conspiracies.

So the techniques that I have recently seen in an O'Reilly Webcast can make them accomplish their goals. The webcast’s duration is 1:00:16 so if you don’t feel to spend this time to watch it then you must read this brief summary, with these 10 ways a database can:

  • Loose Data
  • Be Insecure
  • Become Un-Maintainable
  • Stifle Changes and Make Everyone Miserable

1)One Big Spreadsheet Method:-
This was a classic database technique that was used in early 90s. In this method they make just one table rather than making relational database with multiple tables, so all the data is dumped in one table. In this scenario your table could have more than 100 columns and that makes searching a nightmare.

 2)Random Naming:-
When we are making table we normally make some standards for naming the table so that if another person see the table he may understand it easily. So for making life difficult for others make your own standard for naming the table and their fields and when a new person would come and see unusual naming he will surely have to spend a lot of time to understand the table and may end up calling you to explain what the table is. For example you can use some times camel case or concatenate some table name, somewhere use plural names and somewhere singular and just like that make the names muddled.

 3)No real key
They ensure that there is no real unique value in the table.

 4)No Foreign Key:-
Foreign keys normally help cleaning up the data and they show a better relationship between data. So by not having foreign keys, it is very difficult to clean up the data. After after cleaning up the data then searching would be impossible because of the orphan rows.

5)No Constraints:-
By inserting constraints in the table we ensure that the user can only insert the valid data. So no constraints just allow the users to insert garbage data.

 6)Non-Atomic Fields:-
A non-atomic field is a field which contains two or more pieces of information in one column and they can be separated into more than one column but still for messing up your database they place this in one field .Easiest example for this is for name that we normally have two or three fields for the name like first name, middle name and last name so by placing it in one field it would be very difficult to search their a certain part of their name.

 7)Magic Number:-
Magic numbers are those numbers which are not valid or which will be never validate in the database. For example the price of a product can never be -1 or 0.

 8)Polymorphic Field:-
The idea of the polymorphic field is to have a field that means something different according to the value of some other field. For example if we have record in which contact information of anyone is saved. So apart from having different field for different types of contacts they can have one field of preferred contact and the other field having contact information according to the preferred contact given.

 9)EAV (Entity attribute value):-
It is a method, they make a separate table for saving the attribute of some entity rather than making some fixed fields in any other table, so this will allow the user to add as many attribute of the entity at run time. For example for saving the attributes for any person we can make an EAV table with fields of Id, property, value. Id will define the attributes, property would be the attribute that is defined and value would be the state of the property defined. But by doing this searching may become impossible and it may require multiple sub queries for searching any data.

 10)Let the ORM Take Care of It:-
Object-relational mapping in computer software is a programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages. So if we use ORM to make relational databases model then it can have some or all the other 9 problems that are discussed above because designing a relational database model is a very sensitive issue and it takes a lot of analysis to make it, so a computer program will surely have mistake in it and can make our life difficult.

Watch the webcast: