Skip to main content

Node.js fork is slow; Deal with it

· 5 min read

Yes. I know. Forking a process in Node.js is slow. Instead of crying about it, let's see how we can handle it!

Let's assume that you have a service in which you:

  1. Accept a request
  2. Fork a process with child_process.fork
  3. Execute some code within that process
  4. Exit from the child process
  5. Complete the request

Probably the first thing you tried was to receive the request, spin up a process, do whatever you need in the processor, and exit. You timed the whole thing and your jaw dropped that it took a million years for the request to complete, even if you are just doing a console.log('I love kittens') inside your processor.

Don't bother. I will tell you right now that the bottleneck is the forking.

How to pass the first round of my interviews

· 9 min read

If you are reading this, then congratulations, you’ve just checked one of the things that I am looking for in a candidate; the ability to do some basic research. In this case, by simply reading information about the company you are applying to.

I am astounded by the number of candidates that come for an interview and have no clue what the company does exactly. Except of what the – clueless recruiter – might have told them, they haven’t even bothered to check the company site in detail. There is occasionally someone that has read the first paragraph of the home page, but that’s usually it. If you don’t give a damn or don’t even have the curiosity to check out the place you will be spending a large part of your day, then I do not want to work with you.

If on the other hand you do give a damn, then keep reading.

Happy 2021!

· One min read

I wish health and happiness to everyone, and anything else that you wish for, and let us hope that this year we will be a better one, COVID free!

Happy 2021 🙂

JavaScript Objects Cachification

· 14 min read

In one of our backend services, we have a class, that is basically the business model of the service and is used in many locations within the code. At some point, we decided that we need to do some caching since a few methods were doing very expensive calls to other remote services and they didn’t need to occur that often.

How do you add caching to a class that is used very often within the rest of the codebase in the least intrusive way? You wrap the prototype of the class of course! And how do you wrap the prototype of the class? With another function that does the wrapping of course!

How to tag data in Redis

· 5 min read

Redis is a wonderful piece of technology. An in-memory, super-fast key-value database, which if you do not already know that it exists, you have been living under a rock.

The cool thing about Redis, is that it supports more data types than simply storing string key-value pairs, and that’s when the fun begins. One of those data types, which will help us with our tagging exercise, is Sets.

Fight or flight? Breathe instead

· 10 min read

We’ve all been there. Feeling the frustration, the unfairness, and the negativity consuming us while everything is getting out of our control.

Emotions take over your brain and you are suddenly overwhelmed by your own feelings, leaving no room for rational thinking. That’s when your flight or fight response kicks in.

Thanks to amygdala hijacking, rational thinking becomes very difficult, and smashing a chair on someone’s face or storming out of a meeting room becomes very tempting. But please, do not do it, and instead, take a DEEP breath in order to make the first step into regaining consciousness.

Remote work tips - How NOT to snap

· 3 min read

Lot of these articles going around these days due to COVID-19, but I felt like giving my two cents since I’ve been a freelancer in the past, mostly working from home, so I know how it feels like.

Despite what everyone thinks about the awesomeness of working from the comfort of your couch, it’s definitely not easy. Αfter a while, no matter how many tips you are going to read, it’s up to you to try and achieve mental toughness.

COVID-19

· One min read

We are facing an unprecedented situation in human history. The COVID-19 virus has affected everyones life and is testing us in ways that we have not been tested before. It has been brutally attacking our health and our economies and imprisoned us in our own homes for our own safety but we need to be patient and go through this together.

Stay safe, be kind to each other and help those that need it.