Thursday, March 9, 2017

Overview of Restify

Restify is a node.js module built specifically to enable you to build correct REST web services. It intentionally borrows heavily from express as that is more or less the de facto API for writing web applications on top of node.js



Express and Restify

Pros

  • Little learning curve, Express is nearly a standard for Node.js web applications.
  • Fully customizable.

Cons

  • All endpoints need to be created manually; you end up doing a lot of the same code (or worse, start rolling your own libraries after a while).
  • Every endpoint needs to be tested (or at the very least I recommend that you hit the endpoints with HTTP consumer to make sure they are actually there and don’t throw 500s).
  • Refactoring becomes painful because everything needs to be updated everywhere.
  • Doesn’t come with anything “standard”, have to figure out your own approach.
  • Express is a great starting point, but eventually you will feel the pain of “roll your own” approach.

Pros

  • Automatic DTrace(comprehensive dynamic tracing framework)  support for all your handlers (if you’re running on a platform that supports DTrace).
  • Doesn’t have unnecessary functionality like templating and rendering.
  • Built in throttling.
  • Built in SPDY support.

Cons

  • The cons are all the same with Restify as they are with Express; lots of manual labor.

2 comments:

  1. The overview of Restify clearly explains its purpose as a Node.js module designed specifically for building REST web services. Its close relationship with Express is particularly useful because developers familiar with the Express API can understand the similarities while also seeing why Restify takes a more focused approach to service development. A Nodejs Course can provide a useful foundation for understanding the Node.js environment in which these frameworks operate.

    ReplyDelete
  2. The comparison with Express also highlights an important practical consideration: flexibility comes with additional responsibility. Manually creating and testing endpoints can lead to repetitive work and make refactoring more difficult as an application grows. Restify addresses some of these concerns with features such as built-in throttling and DTrace support, while avoiding functionality such as templating and rendering. This makes an Expressjs Course relevant for understanding the framework that Restify intentionally borrows heavily from.

    ReplyDelete