Richard Clayton

The case against the generic use of PATCH and PUT in REST APIs

There is a lot of confusion among developers on how to implement updates using a REST API. The tools we are given (PATCH and PUT) don't actually map cleanly to how we would implement an update in our business code. Let's start by considering what those HTTP verbs mean:

PATCH: perform a partial update to a resource, . . .

Read More

March 07, 2018

Enumerations in Node.js and Mongoose

Enumerations are essential to writing good software. Enumerations provide a clear understanding of the set of values that can be used for a property. This ensures we can constrain input to the set of values in the enumeration. Enumerations also signal to the reader the intended behavior of model instances (particularly if the enumerated field . . .

Read More

Posted in: nodejs

March 05, 2018

Custom Errors in Node.js

I'm surprised how little custom errors are used in Node.js and I don't understand why.

I was integrating an open source library last week into a project and I was trying to write unit tests covering all failure cases one could expect with the library. The library, however, didn't make use of explicit error cases. This . . .

Read More

Posted in: nodejs

March 04, 2018

Node.js Process Events

Make sure you are listening to them!

I was troubleshooting a bug recently when I noticed an unrelated issue with one of my microservices. We were experiencing a failure in a non-critical component responsible for notifying our internal staff of a minor issue in our business workflow.

This was an issue our development team, extremely thorough QA team, and Ops team missed . . .

Read More

Posted in: nodejs

March 02, 2018

Update - March 2, 2018

Hello friends! If you follow my blog you will have noticed that I haven't really posted any content in a long time (sorry). The reason is that I was extraordinarily busy for the last 2.5 years designing and building a complex microservice architecture at work (and pouring my soul into the endeavor).

Over the course of that . . .

Read More

March 02, 2018

Serverless isn't Effortless

Lessons we learned in our first serious Serverless project.

I've been working on a fairly substantial Serverless project over the last week and I wanted to offer some thoughts to developers considering Lambda-styled infrastructure.

Usually when I say "Serverless", I mean the architectural style of using Lambdas on hosted infrastructure and not the Serverless project. I will . . .

Read More

October 26, 2017

10 Things I learned Working Remotely

Tips for Professionals thinking about making a go of the remote lifestyle.

There are a lot of misconceptions about working remotely. Many people think it's the ultimate way to liberate themselves from the confines of a traditional office -- with their new found freedom they will be able to dictate their own hours, be location independent, and perhaps work less.

In practice, however, I've come to . . .

Read More

April 10, 2017