How to Handle MongoDB Transactions on your Local Server

Until version 4, MongoDB lacked the ability to carry out ACID transactions. ACID transactions enable database operations (creating, reading, updating and deleting data) to be more resilient and dependable. This is necessary especially in finance-related applications that have to do with transferring money among users. What is ACID? ACID is an acronymn for Atomicity, Consistency, Isolation and Durability. When a database transaction (a group of CRUD operations on a database) is said to be ACID, it means that the database is always left in a valid state even in the event of unexpected errors that occur during the transaction....

February 16, 2023 · 4 min · Orim Dominic Adah
Design JavaScript code with tests in mind

My First Open Source Contribution to Remotion

What is Remotion? Remotion is an open source video-making program built with React. Remotion enables users to create MP4 videos using React. At the time of writing this blog post, the project is recorded to have been used by over 800 developers on GitHub and it has over 15,000 stars. Remotion has been used to make product demos, tutorials and clips for conference talks. Remember the popular yearly GitHub unwrapped videos that show an animated display of developers’ GitHub history for the year?...

February 11, 2023 · 5 min · Orim Dominic Adah
Iterator Design Pattern

The Iterator Design Pattern in JavaScript

In the field of programming, there exists a concept called ‘design patterns’. Design patterns are established solutions to recurring challenges in the field of software design. A sample challenge that requires the use of a pattern is the case of an API endpoint that returns a list of items. It may be fine for the endpoint to always return all the items that the database has for every API call to the endpoint, but it gets to a point where the list of items to return would be unnecessarily large or some of the items in the list returned may not be needed by the client making a request to the API....

February 3, 2023 · 7 min · Orim Dominic Adah
on becoming a Senior Engineer

On Becoming a Senior Engineer

Recently, I was promoted to the level of senior backend engineer. As much as I felt that this was a stamp of recognition on the work that I had done, I felt like an impostor when I compared myself with what is out there. I have been writing code professionally for about 2 years and I have been working remotely at this company for 7 months (probation period included.) Senior engineers usually have 5 years and above of professional experience under their belt....

January 15, 2023 · 5 min · Orim Dominic Adah
setTimeout JavaScript

How does setTimeout Work with the JavaScript Engine?

If one wants a function to be executed just after a period of time T in JavaScript, what do they do? They dump it in a setTimeout and surely, just immediately after T has elapsed, the function will be run. Right? Can you predict what happens when the code below is run? You should try it out in a Node.js REPL or the console. const extractTime = (date) => date.toTimeString().split(" ")[0]; var start = new Date(); console....

January 4, 2023 · 3 min · Orim Dominic Adah
Callback Function JavaScript

What is a Callback Function in JavaScript

You know how you ask someone to call you back in a phone conversation? That’s what callback functions are. They are functions to be called later; after something has happened. In order to grasp this in practice, one needs to understand two things that there is a difference between a function name fn and a function call fn(), that functions can be passed into functions as arguments, the same way that numbers, strings and arrays are passed into functions as arguments The difference between a function name and a function call Let’s consider the code snippet below...

August 7, 2022 · 5 min · Orim Dominic Adah
NestJS Integration Testing with TypeORM and MongoDB

Write Integration Tests with NestJS, TypeORM and MongoDB

NestJS projects that use TypeORM with MongoDB are rare. The recommended ODM1 to use with MongoDB is Mongoose, but the choice is not always within our control. This article is a guide for writing integration tests in a NestJS project that uses TypeORM with MongoDB. Integration tests verify that all units required to accomplish a particular goal work together as expected. For integration tests in a backend application, database calls are not mocked....

April 7, 2022 · 5 min · Orim Dominic Adah
Asynchronous function javascript

What Is an Asynchronous Function in JavaScript?

When you look at the second hand of a ticking clock, you’ll find out that the second hand moves sequentially. It points at 1 before it does 2, and then 3. It does not point at 4 and then 1 and then 9. Now imagine that the second hand is the JavaScript runtime and each number is a function. The second hand, which is our imaginary JavaScript runtime, determines what function runs by pointing at the number....

March 25, 2022 · 5 min · Orim Dominic Adah
Implement JavaScript's setInterval using setTimeout

Implement JavaScript's setInterval using setTimeout

I was in a job interview pair programming session where I was asked to implement JavaScript’s setInterval method without using setInterval itself. I did poorly at that interview for many reasons, including not knowing how to implement this. The question Implement the setInterval function in such a way that executing new SetInterval.prototype.start will start the function passed to it and run the function at intervals interval until the SetInterval.prototype.clear method is called....

June 23, 2021 · 4 min · Orim Dominic Adah
Why start a blog

Why start a Blog?

There’s power in asking why. I’ve found out that in asking why, the underlying source and/or reason for anything can be found. Asking why also enables one to have a clearer view of the purpose of something, and thus, have sound foundations for decision-making. So why am I deciding to start a blog? To improve my technical communication I live among people, and to get my thoughts across to them, I have to communicate....

January 1, 2021 · 3 min · Orim Dominic Adah