NodeJS using redis - installing with hiredis vs without? - node.js

I'm integrating redis into my NodeJS server app, and I'm trying to figure out whether or not to install node_redis with the hiredis command. I assume that the option to install it wouldn't have been made available if it wasn't useful in some way or another. At the same time, the github page for node_redis (https://github.com/mranney/node_redis) makes it clear that upgrading to newer versions of nodeJS can cause problems with the hiredis option added.
Could somebody lay out the unwritten pros and cons of adding the hiredis vs not? How much of a performance increase is there in going with the C library?

For production I would seriously consider using hiredis parser because it performs better. For testing you do not need it. Then when you deploy new version to the server you just recompile hiredis. That is not such a big deal. Also when you have proper tests in play you would notice when something is wrong with redis/hiredis(or any place else).

Related

Create executable and hide application code in Node.JS

I created an application in Node.JS that sends data from a local MySQL database to a MondoDB database in a Cloud.
I want to install it on my clients without them seeing the source code and not even needing to have the Node.JS environment installed. Basically I want to turn it into an executable, as is done in Delphi, then the client would only have the executable and with that in theory it would not have access to my source code and would not even need the Node.JS environment installed, just the executable being enough.
I saw that this is possible using PKG at: https://devpleno.com/hands-on-pkg. But on the other hand I saw many threads on the subject saying that this is not effective, obfuscation techniques, but all aimed at JavaScript for the web, which is not my case, so I was worried.
In my studies on Node.JS all the examples I've seen are kept in production in the Node.JS environment with the code exposed, since they run on the server side and clients don't have access.
But in this case of distributing the app to customers, it made me think, and such doubts arose.
Does Node.JS see this? Is it best suited for this? Are there any more suitable options? Or JavaScript applications, even if they're not for the web, can't be turned into executables that actually hide the source code, and if they can't, why?

I am using Node.js, express, Angular, Postgresql on Windows. What is the best way to mirror and code updates between servers?

I am using Node.js, express, Angular, Postgresql on Windows. What is the best way to mirror and code updates between servers? I have read about rsync. Any other ones out there for the most recent js technologies?
The delivery/deployment/backup of your code is agnostic to the code itself. Therefore a deployment method for "recent js technologies" is nonsensical. I suggest you familiarize yourself with Git as it is the industry standard. It acts a little bit like Dropbox for your code.
Check out this tutorial to quickly get a sense of what git is. https://try.github.io/levels/1/challenges/1
After that, read the official doc to understand how it works under the hood, it'll be easier to deal with issues later if you understand the ins and outs of the tech. https://git-scm.com/doc

do i need to install WebSockets library for node?

I'm reading a book on using node.js for creating real time games.the problem is,it was published on 2011 with older version of node
for example it says :
Next, we will install the WebSockets library for the Node.JS server.
is it still necessary to do this right now with node-v0.12.0 ?
NodeJS does not have a built-in websockets library as of v0.12.0. There are many plugins available, socket.io being one that is currently popular and IMO easy to use (express.io, which combines socket.io + express, is another one I use often when I want to mix http and ws protocols in a single app).
So the answer is: if you want websockets, then yes, you'll have to install something, and it's probably best to use the package / plugin / library that the book tells you too otherwise their code samples might not work (they might not work anyway, unless you go back and get the exact version(s) specified in the book.)

How to connect to Mysql database on XAMPP in AppJS

I am on Linux 32-bit machine and using AppJS for developing desktop application.
After searching for a while,I can't find a way to connect to my Mysql database on XAMPP.
Is it possible to connect or I am wasting my time searching?
Please help.
From this discussion, it seems like you can use available libraries for node to do this. Like node-mysql.
Also I think you should look into this issue.
Quote:
deskshell is the next generation of appjs. Appjs merges nodejs and
chromium's event loop. This is awesome but it means that a long
running nodejs operation will stop animations in the browser and it
means lots of other unexpected side effects. Solution is to run 2
separate binaries (nodejs and chromium) and connect them together
using the chrome remote debugging protocol. Deskshell therefore is
built in javascript rather than C++ and this makes it much more
hackable and quicker to develop. Appjs will be able to be used by
deskshell instead of chromium as the "browser" part of the application
in the future.
But I strongly suggest you look into node-webkit. It is used by apps like Popcorn-Time.

What is the best session store for expressjs to store sessions on a mongodb (mongoose) database?

I am developing an application with Express. I am using memory to store sessions at the moment. However, I would like to store them in mongodb.
I know I can just develop a store (it's just 5 functions). However, I was wondering: is there a good library to do that? I installed connect-mongodb, but apart from the fact that it has ancient versions of connect, bson, mongodb etc. as dependencies... I was wondering what the "current" established way to do this was.
I just found connect-mongo too (just to add to the mix).
Hints?
Merc.
I touched on this in an answer to your other question, but older versions of dependencies don't necessarily mean a module is broken; if the module works with your version of MongoDB and has its own tests that pass, it's very likely it's fine (though it is sometimes worth determining if old versions of modules it depends on had dangerous bugs).
If you decide you don't want to use the module due to the outdated dependencies, you might also look into other modules that are more up to date; at a glance, connect-mongodb might be a candidate.

Resources