Creating a Multi-Tenant Connector Microservice Using LoopBack

Note: This article was co-written by Subramanian Krishnan and Nagarjuna Surabathina.


LoopBack is a highly-extensible, open-source Node.js framework that enables you to quickly create dynamic end-to-end REST APIs with little or no coding. LoopBack allows users to define data models and connect these models to backend systems such as databases via data sources that provide create, retrieve, update, and delete (CRUD) functions. Data sources are backed by connectors that implement the data exchange logic using database drivers or other client APIs. In general, applications don’t use connectors directly, rather they go through data sources using the DataSource and PersistedModel APIs. The models defined in a LoopBack application can be automatically exposed as REST APIs using Strong Remoting. [Source: LoopBack docs] Read more

Systematic Data Design in JavaScript – Featuring Three Data Types

In the previous article, we discussed systematic function design: a test, example, and documentation-driven approach to designing functions using the HtDP methodology. In this post, we are exploring systematic data design in JavaScript.

In this three-part series, we are covering systematic design as it applies to:

  1. Functions
  2. Data
  3. Worlds

Let’s now turn our attention to the design of data. Read more

An Example of Using Environment Configuration in LoopBack

One of the more interesting features of LoopBack I’ve been meaning to take a look at is its support for “environment configuration”. This is a fancy way of saying “configuration based on environment.” I’m still a Node newbie, but this is something I’ve done myself for a while now. Once again, LoopBack really shines here in doing some of the boilerplate code for us. The docs go into great detail about this feature, but I thought a simple example might be useful.

First, a reminder. LoopBack uses JSON files for various different configuration settings. In every case where there’s a JSON file, you can swap it out with a regular JavaScript file to enable dynamic configuration instead. So for example, datasources.json can also be datasources.local.js. (Note – in this case, “local” isn’t referring to any environment. The requirement for the word “local” in the file may go away soon.) This allows you to define the same values the JSON file does – but with JavaScript code. This could be useful for dynamically creating a datasource at run time. (This could lead to some fancy scenarios – so for example, trying to connect to a main database and if that fails, use a backup.) Read more

Securing Your API with OAuth

APIs can be powerful tools for software developers. You can expose parts of your product to users and partners without having to directly build new functionality. If a third party wants to make an application that scans your database and returns specific results, they can use your API to access your system without pulling away your development resources.

APIs can also be scary security vulnerabilities. Parts of your product may be exposed to virtually anyone who knows your endpoint without your oversight or permission. If someone wants to query a billion hits into your database and take your system down, they can do so without even asking.

How can you take advantage of APIs’ usefulness without exposing yourself to major risk? One way is to manage API access through authorization and authentication. In this blog, we’ll be talking about securing your API with OAuth, the open-source authorization protocol.

Read more

More StrongLoop & IBM Sessions at IBM InterConnect 2017

IBM InterConnect is in one week! Last week, we shared a rundown of what our StrongLoop evangelist team would be talking about at the event. Now, we’re excited to share more StrongLoop and IBM Sessions at IBM InterConnect 2017. This is by no means a complete list of the InterConnect sessions, so be sure to get an overview of the event with Week at A Glance and use Watson get information on InterConnect sessions.

InterConnect 2017 March 19-23 in Las Vegas, NV

Read more