Model driven APIs and service

In the past few months, I had been building a set of services using nodejs. After having dabbled in JavaScript over the past year, I was looking for a way to build service side code as well with REST APIs. voila! I discovered nodejs which fits the bill. There are many tutorials online for how to use nodejs (more on that later). One common problem was that I was creating similar boiler plate code for routing, binding, method call, and storage. I was factoring these parts out into separate layers – modules in nodejs. Still I wanted a simpler model. Then I discovered strong loop.

StrongLoop provides a simple framework to define the model which can consist of one or more objects with properties attached to them. Once I have these models with very limited wiring, I have a set of standard REST methods exposed from strong loop. This is cool! Further more the REST methods automatically create, store, and retrieve results from in-memory store. (I found it a bit challenging to deploy strong loop and have to follow their steps methodically.)

Soon we need a way to persist the data. No worries! Strongloop comes with database connectors for standard databases including – mongodb, sql server, oracle, mysql, etc. That database binding was also not painful to establish. Yes the operational deployment to AWS or Azure is not simple for me. I had to wade through many documents to deal with the linux variations. Nonetheless, the model driven API model is here. I was also able to easily extend the standard methods and add new methods to work with the model objects.

I highly recommend folks to use strong loop for easy prototyping. You will have a bit of learning curve, which the StrongLoop documentation can help you with. For big production operations, one has to obtain license from StrongLoop (Which is now part of IBM). Give it a try.

PS: I am not affiliated with StrongLoop or IBM. I happen to be an enthusiastic user of nodejs and I find StrongLoop appealing.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *