Last week I accidentally deleted an entire app from the development database. Yes, you read it right. I wanted to delete one configuration in the app but ended up deleting the entire app. (The app in the scenario stores all the data in NoSQL including user data as well as app configurations).
I know it’s not a good thing to write about, but the learnings I had after this incident were incredible. Here they are:
Music: Music helps you focus on your work but sometimes, beats are so dope that they make you lost in them and you completely forgot what you were doing. This is what happened to me. I was grooving on ‘Brown Munde’ when this happened. And we all can agree, no one can stop grooving when they hear —
Oh Desi Jehe Geet Aa
Trap Jehi Beat Aa
Sirr Kadh Gajde
Speaker’an Ch Wajde
Brown Munde Brown Munde
No matter how dope the beats are, our focus should always be the primary task we are doing. Even a slightest distraction can make things worse, be it posting a private photo online, liking a photo your ex posted a year ago, or deleting a week’s worth of work.
Warnings: Warnings are the most underrated things in the computer world. We don't care what our system is trying to tell us until it is an error. Well, the confirmation/ warning before deleting something is there for a reason. We are so wired to press return after pressing the delete button, we hardly double confirm if we are deleting the desired file. We should take warnings/ confirmation more seriously. This was my second mistake. I just assumed I was deleting the correct file.
Backups: Backups are really important. We don't care about backups when everything is going great. Taking backups feels like lazy work and we keep postponing it. But backups are the true savior. I had a backup of configurations from a week ago. I was able to restore the application and it saved me a lot of embarrassing conversations.
Writing it down: Sometimes what happens is while developing new features, we brainstorm a lot. Writing down the final solution neatly can save a lot of trouble if something broke and needs to be reimplemented. Documentation comes in handy in such situations. Good documentation about the implementation can save a lot of time especially when code or configurations are deleted and there is no way to recover them. Luckily, I had written down one of the flow which I was brainstorming throughout the week neatly on a piece of paper and it saved me a lot of time in implementing a week’s worth of work.
Lastly, find few friends who can say, Rishi you need therapy or they are proud of me, when something like this happens and make you question how careless have you become. Well, in this case, my friends were pretty useless apart from passing some sarcastic comments, but since I promised them that I will feature them in this post, so here they are. The Most Awesome Sumedh Nimkarde (as requested by him), Nirav Bharadiya, Kevin Amipara, Shubham Bagrecha, Shailesh Baldaniya you guys are amazing :)
PS: It was a dev project on my local machine and I was able to restore the app in a couple of hours. It shouldn't have happened but as they say, to err is human and I am just a human being. Lessons learned.