Raven
Raven

Reputation: 689

Need a solution for an Electron application that uses a shared database

I understand that node-mysql can be used for a database with Electron. However, if I build my app, the user will still need MySQL installed on their computer correct? I need a database solution that multiple users of my app can use without having any other dependancies installed. Just my standalone app. Are there any solutions for this?

Upvotes: 2

Views: 2862

Answers (2)

Tom Van Rompaey
Tom Van Rompaey

Reputation: 3586

You can use PouchDB inside your Electron application and set up a remote CouchDB.

PouchDB can work offline inside your application and can synchronize with CouchDB. If you use sync, every time the remote database changes, all connected applications will pull the latest changes to their local database.

Sync will be in two directions (if you want this, otherwise you can use replicate), so when an application makes a database change inside their local PouchDB, it will synchronize this to the remote CouchDB, and all the other applications will also pull this change.

Upvotes: 3

Akarsh Satija
Akarsh Satija

Reputation: 1805

Well, Correct would be to connect your electron app to a remote DB and setup an auth and set up DB behind that. You can also use DB's auth.

or if you can have individual DB per user. You can use Sqlite.

Upvotes: 0

Related Questions