Search code examples
apiloopbackjsrestify

Loopback or Restify?


Starting a new API, what gives the best security and speed? Loopback or Restify?

It seems that restify have more than 60,000 downloads last week, on the other hand Loopback is backed up by IBM and have plenty of plugins and security implemented by default.

Benchmark wise there is none to compare but I'm having issue installing Loopback on Nodejs 8 or 9 : Command: sudo yarn global add loopback-cli

[email protected]: The engine "node" is incompatible with this module. Expected version ">= 4 <= 6".

What platform should I start my API with? I could wait for Loopback to support node 8 or 9.

I hope I can get an answer even though it might be subjective. I really need some insight on this.

Edit: Added the command used to install loopback. Also thanks for providing insights even if this is not really a pure SO question.


Solution

  • Restify

    Restify is a relatively old player in the Node.js API field, very stable and being actively developed. It is purpose-built to enable you to build correct REST web services and intentionally borrows heavily from Express.

    The main advantages are :

    • Automatic DTrace 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.

    The main disadvantage with Restify as they are with Express requireslots of manual work.

    Loopback

    Restify is a great starting point, but in the long run it might not be the right choice if you plan on investing heavily into APIs.LoopBack is a fully featured Node.js backend framework to connect your applications to data via APIs. It adopts the convention over configuration mantra popularized by Ruby on Rails.

    The main advantages are :

    • Very quick RESTful API development.
    • Convention over configuration.
    • Built-in models ready to use.
    • RPC support.
    • Fully configurable when needed.
    • Extensive documentation.
    • Full-time team working on the project.
    • Online support support.

    The main disadvantage is that learning curve can be pretty steep because there are so many moving parts.

    You can now decide yourself according to your needs. I hope it helps