Local and remote databases


#1

Hello everyone!

I am just starting to use Electron and I have a question about databases. Due to the kind of App I am developing I need a relational DB.

The idea is the user will open the App, if there is connection it would store the data both locally and remotely. If the App is offline it will store the data locally and whenever is online again it will send that data to the remote server. Basically it will be thee same database (local and remote) but it can work offline if necessary.

I am lost on which database will be better for this. As I said I am using MySQL right now and I know you can use MySQL with nodejs so I might give it a try. Also, I am used to use MySQL within a backend language such as PHP, how would you do it in Electron?

Thanks for your time guys!


#2

Bump! Anyone has any idea about this? I still can’t find any reliable info! :frowning:


#3

Synchronizing database contents is a hard problem (see also “database replication”). I doubt you’ll find a simple answer.


#4

PouchDB + CouchDB may be a good solution.

PouchDB(local): https://github.com/pouchdb/pouchdb
CouchDB(remote): http://couchdb.apache.org


#5

@itcook I thought about using them, the problem is that I need a relational database and both couch and pouch are nosql.


#6

I’ve been working in a app with these features. I’ve been using NeDb for local database and I developed rest services on remote app to synchronize the relational database. It’s working very. NeDb performance is very good.


#7

is there a way to sync with nedb and mysql