Skip to main content

Posts

Showing posts from May, 2019

DI : The Buzzword

On the last Monday morning, when I was reading " this blog " I came across this term 'injector' for enough time to give it a thought and dig into it. and That's how I got started with it. DI: stands for Dependency Injection (ugh! what a fancy and confusing name!) It is a very famous code pattern to make the codebase more cohesive and loosely coupled. Often, while coding, we write some classes which internally initialize the objects of other classes. And thus the earlier class become dependent on the object creation of the later class. But, thoughtfully speaking, a class should be cohesive and should do nothing more than it's a purpose. For example, we have a class Employee and a class Address . Where an object of class Address is aggregated inside Employee class. Thus, Employee class, while providing a blueprint of an Employee object, now manages the creation of Address object too. This adds up the dependency and makes the class, less cohesive.

The stuff you should know about InnoDB | MySQL storage engine

It's been quite a while after the first blog about Storage Engines . But after that blog, the thing that hit me was how the databases like the great MySQL and the legend PostgreSQL works(subjective). While exploring MySQL I came across the famous, and default storage engine of MySQL , i.e. InnoDB . Whenever you create a table without mentioning 'ENGINE' attribute in a query, you are telling MySQL to go and use InnoDB to create the table. Well, there are many amazing/awesome/mind-forking storage engines that can be used instead of InnoDB . But, as InnoDB is the default, we should not hesitate to explore it. What is InnoDB?               InnoDB is the general-purpose storage engine that balances high reliability and high performance. Reliability is the fault tolerance quotient of the system. In MySQL 8.0 , InnoDB is the default MySQL storage engine, unless you configure it with other storage engines. What the hell InnoDB has? B-Tree indexes (u