TypeScript Tuple

samundrak

samundrak

JavaScript Dev

TS tuples are the same as an array but are subtypes of the array. Tuple can be defined in a special way that has fixed lengths where the values at each index have a specific and known value. Tuples have to be

Notification Service Architecture

samundrak

samundrak

JavaScript Dev

A system which notifies the user when some event occurs. Users will be notified about the activity or event generated from different parts of our application, for example, birthday notification, quote received, lead generated, etc. The system can notify users using a different medium like email, push notification, SMS(mobile), WhatsApp.

Linux CLI Tips

samundrak

samundrak

JavaScript Dev
  • A single dash normally means a short name of the flag. E.g ls -a

  • A double dash is passed to express a long flag. Ex: ls -all

Entity and attributes in DBMS

samundrak

samundrak

JavaScript Dev

An Entity in DBMS refers to the data which can be real objects or virtual things. An entity contains multiple attributes to describe themselves. Normally in DBMS table contains a set of entities and can have relations with other entities in other sets.

Column oriented database or Row oriented database

samundrak

samundrak

JavaScript Dev

Database types and storing way don't matter much when we don鈥檛 have a big amount of data but as our data grows, we start facing issues. Many of us will start fixing by reducing multiple joins where it is not required. Also, start denormalizing as we normalized it soo much that we now have to join 5+ tables to get just some counts. This thing does matter but sometimes we also have to think about how we are storing our data and what type of storage engine we are using to fetch records faster.

Performance Improvement by useCallback, useMemo and React.memo

samundrak

samundrak

JavaScript Dev

React is fast on its own, It does a lot of work to make our web app more fast and smooth and on top of that today's browser engine is doing a perfect job to optimize the code we throw to them. v8 has TurboFan which does some next level of optimization. These are the things that are done for us by someone else but there is still a lot of things that we can do to improve our application. I will not write about web application performance and optimization process here because this note was specially written for optimizing React apps which uses hooks and I mentioned other things because sometimes we do overengineer in the name of performance, which I think I do sometimes (Premature Optimization).

I use React hooks a lot and many times I get stuck thinking about how I can make it work faster, which hook can be useful here to store data, memoize data, etc.

Single Responsibilty Principle

samundrak

samundrak

JavaScript Dev

What is a SOLID principle? It was a common question asked in an interview when I applied for a PHP developer. This term is seen a lot in the PHP universe and JAVA too. If we search it on youtube then we will find that most of those videos are hosted by uncle Bob martin. The SOLID principle is a set of principles. As our codebase grows in size it can be messy, unorganized, fragile, etc. There is no proven method to make our project stable because software development is an iterative process. Things today we write can be changed tomorrow, the module we create today can no longer be fit in our codebase. That doesn鈥檛 mean we should not care about our codebase. We can apply some principle which can help us to do less refactor, fewer code changes, less dependency or organized dependency, etc.

Monorepo experience

samundrak

samundrak

JavaScript Dev

Monorepo is a repository pattern where we manage multiple packages in a single repository. Normally what we do is create a separate repository for each package and maintain all those packages by tracking their version and release. In Monorepo we put all of our packages in a single repository.