A better API validation strategy

As an API developer, you will eventually need to determine how to handle data validation. The .NET ecosystem offers a few options, the first option, validation attributes, can be used to annotate how a model should be validated. Validation attributes are great, they don’t require any external dependencies, you can specify error messages, create your own custom validator, validate against many data types. For example, take the following Movie class, notice how the properties have been annotated with validation rules....

October 9, 2021 · Yunier

Improving a CPU-intensive Node.js app

Recently I was asked to review a Web API written in Node.js. The API exposes an authentication endpoint, this authentication endpoint must be highly available, responsive, and it cannot become a bottleneck, otherwise, the user experience is severely impacted. Unfortunately, the endpoint had become a bottleneck and was impacting the overall performance of the application. Upon further review, it was determined that the problem was coming from a hashing function that takes the user’s password, hashes it, and compares the result with the stored hashed password from the database....

September 19, 2021 · Yunier

The order of Interfaces impacts performace

I was looking through some of my bookmarked Github issues when I rediscovered issue #32488, in that issue a comment was made that caught my attention. The comment stated that in .NET the order of interfaces impacts performance. This is because in the .NET CLR all class definitions have a collection of methods and interface definitions. Casting is a linear search that walks the interface definition. If you are constantly casting to an Interface located at the end then the CLR must do a longer walk....

August 28, 2021 · Yunier

Writting a good ReadME is a skill

Writing good documentation is such an underrated skill, to that extent so is writing ReadME files, ReadME files can be an awesome addition to your project. They give you an opportunity to document all sorts of stuff. For me, a good project should come along with a good ReadME file. The file should outline everything that is necessary for me to interact with the project. Like how to run the unit/integration test, the project’s architecture, any terminology, the roadmap for the project, and the most important piece, examples on how to use the project....

August 25, 2021 · Yunier

The Platform

HTML, CSS, and Javascript, are the languages of the world wide web, the platform. They are used to create websites, to make them interactive, and to make them beautiful. At one point in my career, I was more plugged into this world. A world that I feel I’ve fallen behind since I myself have not exclusively worked on a UI project since the days of AngularJS. That doesn’t mean that I don’t do any front-end work anymore, it is just that these days I spent most of the time doing back-end development....

August 18, 2021 · Yunier