Rob Tweed · Jan 21, 2019 go to post

Ward is correct - ewd-document-store is the way to go.

For background on this module, the thinking behind it and some of the considerations you need to be aware of when using it (which ultimately explain what QEWD.js is all about and why it is what it is), see this presentation that I gave a couple of years ago at the UK Symposium:

https://www.slideshare.net/robtweed/data-persistence-as-a-language-feat…

Also see here for pointers to further info on the persistent JSON / Document Database abstraction provided by ewd-document-store:

https://github.com/robtweed/qewd/blob/master/up/docs/InteractiveApps.md…

Note that ewd-document store will work with any version/build of Cache, Ensemble or Iris

Rob

Rob Tweed · Dec 17, 2018 go to post

Everyone else makes Node.js modules such as these available via NPM. 

Rob Tweed · Dec 17, 2018 go to post

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-i…

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.

Rob Tweed · Dec 14, 2018 go to post

That's a code sequencing issue.  Change the end of Ward's qewd-start.js file to this:

let qewd = require('qewd').master;
// define the internal QEWD Express module instance

// start the QEWD server now ...
qewd.start(config);

let xp = qewd.intercept();
// define a basic test path to test if our QEWD server is up- and running
xp.app.get('/testme', function(req, res) {
  console.log('*** /testme query: ', req.query);
  res.send({
    hello: 'world',
    query: req.query
  });
});

and it should work for you

Rob Tweed · Dec 13, 2018 go to post

Since QEWD is a JavaScript / Node.js project, GraphQL is pretty much automatically supported via the standard Node.js GraphQL module that has been provided by Facebook.

When I get some time I'll write some notes on how to integrate it with Cache using QEWD

Rob Tweed · Dec 2, 2018 go to post

Alternatively you could use proper JavaScript via Node.js and the cache.node / iris.node interface :-)

Rob Tweed · Aug 28, 2018 go to post

Thanks Ward for raising awareness of the QEWD / IRIS demo while I'm away!

Evgeny - I'm on holiday right now and quickly integrated IRIS with the Conduit / RealWorld back-end code before I left - I didn't have much time and hadn't tested the demo out.  It's actually an interesting "hybrid" version of the back end that works with both WebSockets (the version you see in this demo) and REST (which you would see if you pointed a "vanilla" Conduit front-end at it.  

I pushed out a new version of QEWD to formally integrate IRIS, and also a new supporting module: 

https://github.com/robtweed/ewd-qoper8-iris

Just specify the database type as "iris" in your QEWD startup file, and provide the other parameters (username, password, namespace etc) just as for Cache.

Needless to say, the demo you see works identically, with exactly the same Node.js code, for all supported databases, so you'll just have to take my word, for now, that it really is working with IRIS! :-)  Actually the performance will indicate that it's hooked up to a pretty fast DB (and yes, it really is IRIS, running on an AWS EC2 Ubuntu machine): see the response time recorded in the raw response messages that you'll see if you enable your browser's JavaScript console.  All the data is being stored in IRIS as persistent JSON - see Slide decks (part 17 onwards) here:

http://docs.qewdjs.com/qewd_training.html

When I get back from holiday, time-permitting, I intend to put together some proper, updated source code for the Conduit app that people can try for themselves, using pure REST (which is probably what many / most want to see) and also (again time-permitting) do a MicroService-based version. 

However, the code base you've found will give you an initial idea how a QEWD / IRIS application would be written (though there have been some enhancements that have simplified some of the coding still further since I wrote the Conduit app).  This slide deck is up to date and explains the way you write REST apps these days:

https://www.slideshare.net/robtweed/ewd-3-training-course-part-31-ewdxp…

I'll also check out the Comments asap to see if / why they aren't working as you report.

In the meantime, enjoy!

Rob

Rob Tweed · Aug 14, 2018 go to post

Can you provide me with an IRIS license and cover the cost of the GCP Cloud Hosting for the purpose of a demo?

Rob Tweed · Aug 14, 2018 go to post

If you can provide me access to an IRIS system on GCP Cloud, then sure.

What functionality would you like to see, and what would the target audience be?

Note: I'm not around to do anything until early September

Rob

Rob Tweed · Aug 11, 2018 go to post

As QEWD makes use of the InterSystems Node.js connector which is available for both Cache and IRIS, the answer is yes. 

Rob Tweed · Aug 10, 2018 go to post

Alternatively...

For those interested in exploring and using MicroServices with all versions of Cache today, QEWD.js has provided a very cool set of Open Source solutions and advanced functionality for a year now.

The full detail is described in the following parts of the Online QEWD.js Course:

https://www.slideshare.net/robtweed/ewd-3-training-course-part-43-using-json-web-tokens-with-qewd-rest-services

https://www.slideshare.net/robtweed/ewd-3-training-course-part-44-creating-microservices-with-qewdjs

https://www.slideshare.net/robtweed/ewd-3-training-course-part-45-using-qewds-advanced-microservice-functionality

And QEWD.js is an ideal and very powerful, modern Open Source REST platform for Cache.  See:

https://www.slideshare.net/robtweed/ewd-3-training-course-part-31-ewdxpress-for-web-and-rest-services

 And all for free :-)

Rob Tweed · Jul 31, 2018 go to post

QEWD supports Cache Objects for those who wish to use them via the cache.node APIs for Cache Objects.:

https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KE…

Your handler logic (which runs in a QEWD Worker process) has access to these APIs via the "this.db" object, eg this.db.invoke_classmethod()

The following post is a bit old and refers to how you used these APIs in EWD.js.  However, change the invocation to this.db.xxx() and the examples should work in QEWD:

https://groups.google.com/forum/#!searchin/enterprise-web-developer-com…

Personally I prefer to use the Cache database as a persistent JSON database / Document Database, via the ewd-document-store abstraction that is used by QEWD, and integrate that storage into JavaScript Objects.  But Cache Objects will work with QEWD and GraphQL just fine

Rob

Rob Tweed · Jul 31, 2018 go to post

As I release my code as Open Source, I've no idea of usage stats.  There's growing interest in the use of GraphQL in the community I work within these days, for all sorts of reasons.

QEWD is a re-badging of EWD 3, so yes, it is supported in QEWD - which of course is straightforward since QEWD is JavaScript/Node.js and can just use the Facebook JavaScript GraphQL module.

Just making the point that GraphQL and support for it in Cache isn't something new, as those who follow our work at M/Gateway will know :-)

Rob

Rob Tweed · May 31, 2018 go to post

You could take a look at this, which was originally designed, some 4 years ago, to provide browser-based terminal roll&scroll access to VistA.   If you're familiar with Node.js, you should be able to adapt it for your own use:

https://github.com/robtweed/ewdVistATerm

Rob Tweed · May 8, 2018 go to post

The idea of connecting Node.js to Cache is to write your logic in JavaScript, except for where you need to invoke legacy code.  It makes little sense to invoke COS built-in functions such as $h via cache.node.

With that in mind, have you looked at QEWD.js, which makes the integration of Node.js and Cache very much simpler? See:

https://qewd.js.com

To expand the concept of using JavaScript rather than COS as the language for your logic, you might want to take a look at this: https://www.slideshare.net/robtweed/data-persistence-as-a-language-feat…

Rob Tweed · Mar 16, 2018 go to post

The way I'd do this is to not do any JSON handling in Cache itself, but output the data into a temporary global whose structure reflected the desired JSON structure.  Then on the Node.js / QEWD side, point a DocumentNode object at the global and use its getDocument() method - that will generate a JS object containing your data.  Finally delete the global using the DocumentNode object's delete() method

Rob Tweed · Nov 12, 2017 go to post

Hi Malcolm - I hope you mean Node.js 0.10 :-)  0.1 predates even my earliest experiments with Node.js in 2010!

You'll need to talk to your ISC account rep to get the latest cache.node builds.

So the next thing you need to do is look at QEWD.js (http://qewdjs.com) to see how you can really begin to use Cache with Node.js productively

Rob

Rob Tweed · Nov 12, 2017 go to post

The version of cache.node must match:

- the OS you're using (in your case 64-bit Windows)

- the version of Node.js you're using - you haven't specified that

Unfortunately InterSystems so far haven't done the sensible thing and publish cache.node in NPM, so you may or may not find that the versions of cache.node included with your Cache distribution support the version of Node.js you wish to use.

Rob Tweed · Sep 25, 2017 go to post

If any of you are in the London area on Wednesday evening this week, why not come along to the LNUG meeting?  I'll be giving a presentation, based on my "Cake" article.  See:

https://lnug.org/

Rob Tweed · Sep 11, 2017 go to post

Let me repeat this, a programming language MUMPS-Cache objectscript with a built-in database. I think this is a fundamental aspect that they have been missing when others invented new programming languages. They are missing the innate common characteristic that both databases and programming languages share which is the pointer, reference based logic. So I believe it's time to return back and fix this for new generation databases AND post-modern programming languages too.

This is a core part of the QEWD.js project: to make JavaScript a first-class language for Global Storage databases - and therefore give JavaScript a built-in database.  

The cache.node module provides the high-performance in-process connection needed to allow the intimate relationship between JavaScript and the Cache database engine.  The ewd-document-store module aims to provide the JavaScript equivalent of the ^ in COS (ie blurring the distinction between in-memory and on-disk JavaScript objects). 

JavaScript's dynamic, schemaless objects are a perfect fit with the dynamic, schemaless nature of Global Storage, making it an ideal modern substitute language instead of COS.  

For more information see the online tutorial at http://docs.qewdjs.com/qewd_training.html  - specifically parts 17 - 27

Rob Tweed · Sep 5, 2017 go to post

I've now implemented the functionality for JSON Web Tokens and QEWD-based MicroServices.

All the detail is described in the following parts of the Online Course:

https://www.slideshare.net/robtweed/ewd-3-training-course-part-43-using-json-web-tokens-with-qewd-rest-services

https://www.slideshare.net/robtweed/ewd-3-training-course-part-44-creating-microservices-with-qewdjs

https://www.slideshare.net/robtweed/ewd-3-training-course-part-45-using-qewds-advanced-microservice-functionality

If you're just getting started with QEWD. t's a good idea to understand how to use it as a straightforward REST Server first:

https://www.slideshare.net/robtweed/ewd-3-training-course-part-31-ewdxpress-for-web-and-rest-services

As you'll see once you start to delve into these tutorials, this is a very powerful technology, aimed at delivering massively scalable, high-performance, highly-secure distributed and federated solutions - all available today for your Cache-based applications today with Open Source software.

----------------------------------------------------------

As a reminder to anyone new to QEWD: an introduction on the thinking and architecture behind QEWD: 

https://medium.com/the-node-js-collection/having-your-node-js-cake-and-…

For an overview of the whys and hows of QEWD's JWT and MicroService Architecture:

https://www.slideshare.net/robtweed/qewdjs-json-web-tokens-microservices