The Node.js-based QEWD-JSdb can be set up to work against IRIS. Here's how you can access its Global Storage:
- Log in to post comments
The Node.js-based QEWD-JSdb can be set up to work against IRIS. Here's how you can access its Global Storage:
In that case I'll wait for a different competition :-)
That depends on your definition of "REST API on the Intersystems IRIS side". That Intersystems IRIS provides the HTTP interface? and/or the code that does the work of the API is within IRIS and therefore ObjectScript? As far as QEWD is concerned, Intersystems IRIS is simply a persistent JSON store with no other role (though you still can invoke ObjectScript methods and access classes if you want), so a REST API is implemented in JavaScript and handled by Node.js/QEWD.
So, provided Intersystems IRIS is used as the back-end database for the data persistence of the APIs, the competition allows the use of any other technologies in front of it? eg QEWD/Node.js + browser UI?
These competitions appear to demand the use of Cache ObjectScript rather than any other language. Is this correct? And if so, why can't other languages be used instead?
Try using this interface module instead: https://github.com/chrisemunt/mg-dbx
These APIs appear to be synchronous, and therefore will not be usable in a standard production Node.js environment where all concurrent users coexist in the same physical process.
This is precisely the reason why QEWD was created - ie to allow the safe use of synchronous APIs, but, then again, if you use QEWD, you won't need or use the APIs described here
They aren't products as such, more repositories that focus on particular aspects of / components within QEWD, to help people get up and running with them. They are linked from the main QEWD repository, which, in turn, is linked to your Open Exchange.
QEWD is already listed, Evgeny.
Take a look at QEWD:
This is a good place to start: https://github.com/robtweed/qewd-baseline
There are instructions on how to try it out with IRIS, but Cache is also supported (all versions)
Both REST APIs and interactive browser-base applications (and Native Mobile apps also) can be quickly and easily developed. Security is built-in and it's all Open Source.
QEWD main repository: https://github.com/robtweed/qewd
See also QEWD-JSdb: https://github.com/robtweed/qewd-jsdb
An update: the QEWD-baseline repository now also includes a fully-detailed tutorial on creating interactive, WebSocket-based browser applications
If you want a very rapid way to develop your IRIS applications using WebSockets, and where all your logic is written in JavaScript, and where your IRIS data is accessed as QEWD-JSdb multi-model persistent objects, this is the place to look.
For more info see:
https://github.com/robtweed/qewd-baseline
and specifically:
https://github.com/robtweed/qewd-baseline/blob/master/INTERACTIVE.md
By the way, the same techniques can be applied to Native Mobile application development
I guess I'd summarise the "so what?" about QEWD-JSdb as follows:
The "conventional" approach to database thinking is that your data is "over there" somewhere in some strange and alien technology called a "database", which also forces a particular type of data model on you and via APIs or protocols you have to learn. It tends to result in two types of developers: application developers who know a language, eg Node.js/JavaScript and build application logic,; and database developers who understand the black arts of data management but don't get their hands dirty with application development.
The key concept in QEWD-JSdb is that the underlying IRIS database is accessed as JavaScript Objects that happen to be on disk rather than in-memory, and can be modelled how I, the developer, wants to handle it - which may differ depending on how I want to deal with the same data. There's no "database", just JavaScript objects that happen to persist in IRIS by means that I neither know nor care about.
That kind of concept may ring a bell with some older IRIS developers, but to a modern audience it's potentially mind-bending, radical stuff. Perhaps so, but QEWD-JSdb now makes it possible in a modern Node.js / JavaScript setting.
I suspect, also, for many developers new to IRIS, it will demonstrate ways of using its underlying physical storage that they never realised were possible.
If that's piqued your interest and you have 5 minutes spare, that's literally all it will take to have it up and running and ready to play with. The browser-based viewer application will give you a real-time view of the IRIS database items you're playing with and how they change as you use QEWD-JSdb, so it's all "instant gratification!" and lots of (hopefully jaw-dropping) fun.
Just the thing for long, dark winter evenings by the fire-side :-)
Perhaps in time, but all the data models are described in detail in the associated documentation, plus you can try them out for yourself using the Explorer apps and associated viewer app. For now, therefore, I'd encourage people to take the time to read and follow the docs and take the tutorial
Rob
One limitation I can see straight away is that this version only includes outdated files for Node.js (ie the iris*.node files). All I see is iris610.node and iris700.node. Is there a reason why the Node.js version 8 and version 10 interface files haven't been included?
Why aren't they made available using NPM, which is where a Node.js developer would expect to find such modules?
Evgeny
I seem to be stuck in "awaiting approval" status, so am unable to make the change you're wanting
I provided an external article link. What do you suggest I use instead.
I entered the version number of QEWD as 2.44.23 which is what it is set to on NPM - why has this been queried?
Submitted now, awaiting approval
You might want to take a look at QEWD? See my recent posting in the article on the IRIS Community Edition for AWS
See also
https://github.com/robtweed/qewd
https://github.com/robtweed/qewd/tree/master/docker-server-iris-ce-aws
https://github.com/robtweed/qewd/tree/master/up/docs
For an example where it's being used in the NHS (in a pilot) with both desktop and mobile devices: https://ripple.foundation/
Rob
Since its earliest days, QEWD.js has supported WebSocket-based applications - with the WebSocket side of things all taken care of by Node.js (specifically using the socket.io module) rather than Cache/IRIS.
Now that it's quick and easy to try out QEWD with IRIS (by using my extensions for the IRIS Community Edition for AWS), you can see QEWD's Web-Sockets based applications for yourself - the QEWD-Monitor application is one that comes "out of the box" for you. However, QEWD makes it very easy to create interactive browser/mobile Web-Socket based applications that integrate with IRIS. See:
https://github.com/robtweed/qewd/blob/master/up/docs/InteractiveApps.md
For information on getting QEWD running wih the IRIS Community Edition for AWS, see:
https://github.com/robtweed/qewd/tree/master/docker-server-iris-ce-aws
I now have QEWD working in the IRIS Community Edition for AWS environment. To get it running I've had to create a new Container that is derived from the one provided in the Community Edition EC2 platform.
I've done all the hard work for you, and It's all documented here:
https://github.com/robtweed/qewd/tree/master/docker-server-iris-ce-aws
Please give it a try!
OK I seem to be on my own sorting this out...but I seem to have figured it all out. I had to first adapt the changePassword utility to work on my derived Container, and once that was done I could use the System Management Portal - which showed me that the Callin Interface wasn't enabled. Once I enabled that, QEWD burst into life :-)
So a question (if anyone out there is listening) - is there a configuration setting somewhere to enable the callin interface automatically when you start up the container, ie to avoid the need to manually enable it via the System Management Portal?
OK Two steps forward, one step back.
When I try to connect to IRIS via the iris.node file and use the db.open() function (from within the container) I get this error
{"ErrorMessage":"Authentication: IRISSecureStart() : Access Denied : Check the audit log for the real authentication error (-15)\n","ErrorCode":-15,"ok":0}
Any ideas what's causing it and how to fix this?
Rob
Ok forget all that - I've figured out how to make it work and will report back later with the solution :-)
One further observation: setInterval() definitely hangs everything. However setTimeout() works just fine
I don't have accounts on GCP or Azure and am not familiar with their use. I use AWS EC2 all the time so I know how to work with it. The problem is unlikely to be AWS-specific, however
OK some further digging reveals that the main problem is that QEWD is freezing at the point where it tries to start the Node.js Express web server.
I'd guess the reason is either:
- something to do with the way Express works internally that clashes with iris-main; or
- port 8080 (which is the port I'm telling Express to listen on) being unavailable because of something IRIS has done
Anyone have any clues?
There's a second problem which is that the Node.js setInterval() function appears to freeze iris-main - something that is pretty critical to have working in QEWD
I've spent quite a number of hours trying to figure out a way to modify the IRIS Container within the AWS Community version so that I can get it to run QEWD.js. I've been able to build a new Container derived from the one provided in the AWS EC2 instance into which I install Node.js and the QEWD modules, etc.
However, using the --after parameter in the docker run command, it looks like iris-main is blocking something - the QEWD Node.js startup code appears to just hang, I think because console.log is unable to write to STDOUT - presumably because of something iris-main is doing. It looks like running iris-main and Node.js together doesn't want to work
I've hit a brick wall with this now and don't know if there's any way to get QEWD working in this AWS EC2 instance, which is disappointing
Fabian
You misunderstand: ewd-document-store is an abstraction built on top of the InterSystems Node.js client, NOT an alternative to it. QEWD uses the InterSystems Node.js client via ewd-document-store, so once again, QEWD isn't an alternative to the Node.js client, but makes it a lot easier to use with IRIS or Cache.
You can't directly filter objects with IRIS NoSQL storage (aka Global Storage) - instead the trick it to maintain indices to optimise iteration - see Ward's follow-up comment., and study those slide decks I've created that describe how to use QEWD's abstraction of Global Storage.
BTW you can further simplify and optimise the performance of Ward's forEachChild() logic like this:
customerNode.forEachChild(function (customerId, childNode) {
if (childNode.$(['Address', '1']).value === 'London') {
// do what's needed with a London customer ...
}
});ie by using the childNode argument of the forEach() and using the $ array feature
Rob