Article
· Dec 13, 2018 2m read

QEWD-Up: A New, Fast-track way to create REST APIs

There's a new and exciting enhancement to QEWD that has just been released - it's an additional layer of abstraction known as QEWD-Up.  QEWD-Up hides away all the mechanics of QEWD itself, allowing you to focus on just your REST APIs and the code that implements them.

Additionally, and importantly, QEWD-Up simplifies the maintenance of your REST APIs, allowing you (and others) to quickly and easily understand their life-cycle and implementation.

QEWD-Up supports both monolithic application designs and MicroService-based architectures where APIs are broken down by, for example, functional role.

You can read all about QEWD-Up here: https://github.com/robtweed/qewd/tree/master/up

Importantly, QEWD-Up runs QEWD as standard under the covers - there's nothing new or unusual that it does - it just automates out of the way all the QEWD-specific stuff that you previously had to write manually.

If you want to see and try out an example for yourself using Cache, Docker and QEWD MicroServices, go here: https://github.com/robtweed/qewd/tree/master/up/examples/cache/ms-db

In addition to QEWD's Javascript/JSON abstraction of Cache Global storage that you'll see in the example above, QEWD also allows to use all the other built-in features of Cache including Cache Objects and Cache SQL, in addition to allowing you to invoke and use Cache ObjectScript (eg for legacy code integration), all from within its Node.js / JavaScript environment.  So QEWD allows you to use all your preferred means of implementing your REST API logic, whilst introducing a whole new additional JavaScript-centric database concept that is described here:  https://www.slideshare.net/robtweed/data-persistence-as-a-language-feature

But with QEWD-Up, you now have an incredibly fast, simple and highly maintainable way of creating your REST APIs

Discussion (3)2
Log in or sign up to continue

Hi Evgeny

Yes - In a previous article I described how QEWD works with IRIS - it simply uses the iris.node connector instead of the cache.node one:

https://community.intersystems.com/post/using-qewdjs-create-rest-apis-iris

Similarly, you can use the new QEWD-Up technology with IRIS.  Just make two changes:

1) In your QEWD-Up application's config.json file, where the Cache version specifies this:

      "database": {
        "type": "cache",
        "params": {
          "path": "/opt/cachesys/mgr",
          "username": "_SYSTEM",
          "password": "SYS",
          "namespace": "USER"
        }
      }

Just change the database type to "iris", eg:

      "database": {
        "type": "iris",  // <====== ****** change this *****
        "params": {
          "path": "/opt/cachesys/mgr",
          "username": "_SYSTEM",
          "password": "SYS",
          "namespace": "USER"
        }
      }

Change the other IRIS connection parameters if needed and as required for your IRIS system (ie path, username, password, namespace)

2) Replace the cache.node connector with the appropriate iris.node version for your operating system and Node.js version. 

When you use QEWD, anything you can do in Cache or IRIS is available to you from within Node.js, and being a Node.js platform, you also have access to the huge ecosystem of OpenSource Node.js modules in NPM to save you re-inventing wheels for pretty much anything you can imagine doing.

Of course, since neither Cache nor IRIS are Open Source products, and since, for whatever reason, neither the cache.node nor iris.node modules are distributed via NPM (which is what Node.js developers would expect), you need to figure out how to manually construct your own licensed Cache or IRIS QEWD-Up Containers.  If you're wanting a native implementation, for the same reasons I'm unable to provide the kind of pre-constructed installation scripts that I otherwise provide for other supported QEWD environments that make life easier for developers.  IMO these kind of issues are a real barrier to wider uptake of Cache and IRIS in the current world of IT, but there we go.

Anyway, if you're interested in using QEWD with IRIS, the best I can suggest is to take a look at the Dockerfile I've created and figure out how to adapt it for use with IRIS using my notes above...or figure out how to adapt an InterSystems-provided IRIS container to make use of QEWD-Up.  IRIS certainly works very well with QEWD-Up when you do get it working, so it's worth the effort!

As to Open Exchange - I'll look into it as time permits.  However, everything I create is Open Source and I publish everything I do on Github for anyone in this community to look at and use.