Distributable database with my application - node.js

I am creating a NodeJs Desktop application using node-webkit and right now using MongoDB as a database.
I want to distribute it as an executable where users will be able to use the application without installing the database by utilizing their own copy of local DB.
Is there a way i can make a local copy for their DB during the installation.
If it is not possible in MongoDB, what other DB should i use?

well its based on your data needs, if you have large set of data you should use mongoDB otherwise there are lots of databases for your NWJS app. check this link https://github.com/nwjs/nw.js/wiki/Save-persistent-data-in-app some of them are good enough to hold big data. but personally i prefer sqlite3 with NWJS(there is a lot of hustle to install it for NWJS) sqlite can work with large data check this page for more info.
if you are going with mongoDB then you should download the the zip not the installer and pack it with your installer the you should be good to go.
by default mongoDB stores its data in /data/db but you can change it to your preferred location

Related

how to access sqlite database from node-red node?

I am creating a node-red API service that access SQLite database using SQLite node.
How to configure the database with SQLite node?
I have hard-coded db file in SQLite node.
What is the right way to develop a node-red API that access the SQLite database ?
I think I want to make the database filename configurable, so that it is fetched dynamically.
I am new to node-red programming.
If the changes are only at deploy time not runtime then you can use Environment variables as described in the doc here
If you replace the path to the DB in the config node with ${DB_PATH} then Node-RED will replace this with the value of the DB_PATH environment variable at deploy time.
Have you looked at the documentation for creation configuration nodes?
https://nodered.org/docs/creating-nodes/config-nodes

Import MS Access data on a Meteor Galaxy server

I need to parse a MS Access database on a Meteor server hosted on Galaxy.
Specifically it's a .accdb file.
If I were able to install mdbtools on Galaxy, the npm package mdb would serve this purpose- but I'm fairly certain I can't install anything on Galaxy hosted servers.
Is there an easy solution to this or do I need to switch hosting/ set up a process on a different host to convert the database to a usable format?
EDIT:
I was able to install and use mdbtools but I wasn't able to get mdb to work on my build. I created my own implementation of mdbtools called mdb-parse. This will not work in Galaxy but seems to me at this time to be the only solution if you need to work with .accdb and .mdb files on Node.js.

Offline-first database instead of sqlite

I found a big, HUGE problem with sqlite3 module. when i try to build for windows, it doesn’t work due to issues between sqlite module and electron-builder.
i was thinking to change te database to something that still works offline.
It’s not important that is a RDMS or NOSQL (all the data are stored in json files on a soap services which i transform in sqlite statement)
the important (vital) issue is that it must work offline.
i've been trying just packing the app using electron-packager
If your main concern is that It should work offline I will recommend give a try to Indexeddb it stores data into the users browser.

Is there a way to self-host mongoose databases?

I am getting started with writing an API for a project and the tutorial I am following suggests I sign up for a hosted solution. I think that is ridiculous. My project is simple and I do not feel the need to be locked in to a service. If it helps, I am using Express.
Mongoose is a node.js module (library) which is used to interact with a database, called MongoDB.
There are some websites like mongolab.com which offer plans for development for free, so you would jsut need to sign up and you will get a database without installink anything in your computer/server etc. This is why they say it is easier.
You can install MongoDB in your local computer to test (I think most of us have it) and use just that one for developing and testing.
To install MongoDB it all depends which Operating System you are using at the moment. But you can look up on google: "Install MongoDB MacOSX/Window/Ubuntu/etc.." and normally is just one simple command. To connect to it in your local you don't need a user or anything I guess.

where does Etherpad Lite store documents/pads?

I am running Etherpad Lite on windows, and apparently it is persisting pads across shutdowns. But where? Does it run sqlite inside the node.exe process? What files does it use to store whichever database it might be using?
They use dirtyDB as its datastore if you dont specify a postgres, sqlite or mysql configuration in $APPDIR$/settings.json
The dirtyDB file path is also set in the settings.json file. -- They recommend using dirtyDB only for testing.

Resources