2coffee.dev

  • Using Clinic.js to Optimize Performance for Node.js Applications
    • node.js
    • performance
    • tools

    Using Clinic.js to Optimize Performance for Node.js Applications

    Since I started programming, I have been obsessed with the performance issues of the programs I write. I often wonder if what I wrote is good enough, if it's optimized, or how many users it can handle at the same time... That was the first step that laid the foundation for a deeper understanding of how programming languages work in general, and Node.js in particular. Over the years, participating in many projects, I realized that optimizing performance is not always easy...

    2 weeks ago

  • What method of pagination are you currently using?
    • other

    What method of pagination are you currently using?

    Pagination is one of the basic requirements for APIs that retrieve data in the form of a list. Pagination aims to reduce the amount of data that needs to be queried and transmitted, as fetching all the data in a long list is inefficient for most common features. In today's article, I will present two popular and easily implemented pagination techniques. Each method has its pros and cons, and I will discuss when to use them in different scenarios...

    2 years ago

  • Premium
    Hello

    Me & the desire to "play with words"

    Have you tried writing? And then failed or not satisfied? At 2coffee.dev we have had a hard time with writing. Don't be discouraged, because now we have a way to help you. Click to become a member now!

    Have you tried writing? And then failed or not satisfied? At 2coffee.dev we have had a hard time with writing. Don't be discouraged, because now we have a way to help you. Click to become a member now!

    View all
  • What is Cluster in Node.js? Using Cluster to increase the scalability of Node.js applications
    • node.js

    What is Cluster in Node.js? Using Cluster to increase the scalability of Node.js applications

    Node.js only has one thread to execute JavaScript code, which means it can only process one JS command at a time. If an application has multiple JS code that takes time to process, a "bottleneck" can occur. For example, your application may handle lightweight tasks but with a large number of concurrent requests, resulting in continuous connection timeouts due to not being able to handle all the requests...

    2 years ago

  • Two techniques to prevent blocking the Event Loop when handling CPU-intensive tasks
    • node.js
    • event loop

    Two techniques to prevent blocking the Event Loop when handling CPU-intensive tasks

    Complex calculations can often cause the Event Loop to become blocked, resulting in unresponsiveness of the server until the computation is complete. Does this mean Node.js struggles with such calculations? In today's article, I will present two techniques to address this issue...

    2 years ago

  • Series
    Never Block the Event Loop
    • node.js

    Never Block the Event Loop

    All requests from receiving to responding go through the Event Loop. This means that if the Event Loop spends too much time at any point, all current requests and new requests will be blocked. We should ensure that we never block the Event Loop. In other words, each callback function should complete as quickly as possible. This also applies to await, Promise.then, etc...

    4 years ago