books icon indicating copy to clipboard operation
books copied to clipboard

backup/sync between instances

Open test2a opened this issue 2 years ago • 11 comments

Since the current software is supposed to be run on the desktop, i could not find a way for the data to be used in a multi-user environment. is that even possible right now? i would want like 5-10 people working on a single company at once, do we open the same DB or have one master and the others send/recieve data from that? how could the software solve conflicts?

test2a avatar Jul 01 '22 19:07 test2a

No, as of now there's no way of doing this, you can store the database file on something like Google Drive and then sync it across all devices but this will still cause conflicts.

There is a plan to add multi-user support but it will take some time.

18alantom avatar Jul 02 '22 11:07 18alantom

It would be great to see a backup/sync option

solancer avatar Oct 03 '22 21:10 solancer

SQL Lite just does not scale when using File System OpLocks... However, client/server database engines (such as PostgreSQL, MySQL, or Oracle) usually support a higher level of concurrency and allow multiple processes to be writing to the same database at the same time. I would suggest you switch to MySQL/MariaDB then mutli-user support should be a lot easier to implement...

hdell avatar Mar 09 '23 07:03 hdell

What about this request? I think it could be very interesting to have this feature! e.g. on the company creation a setup entry where the user needs to select whether he'll work on a "one-man" company on prem (sqlite) or connect to a multi-user environment (Mariadb).

promexio avatar May 08 '23 04:05 promexio

I will be adding backup in the next few months. Multi-user might take longer.

As for MariaDB and SQLite, yes SQLite doesn't have concurrent writes, but considering that Frappe Books for multi-user environment is bound to have much fewer users (order of 10s) than say a full fledged ERP, SQLite still suffices (it is the fastest db out there).

Each instance i.e. company, get's their own SQLite db. This may seem counter intuitive but the portability of SQLite means the same instance can support local and cloud usage. And even readonly modes for say online report viewing (SQLite can run in the browser).

Anyways, the final decision of how to handle multi-user will be on the basis of some experimentation.

18alantom avatar May 09 '23 07:05 18alantom

Ok, I'd be glad to contribute to the testing of that experimentation. For some very small companies, multiuser support is needed as early as there is one person in charge of the accounting / purchase stuff. Even though, if it's just reading reports, I guess some acces via dbeaver or an R{} script would do it, but only until the second person is not working actively ...

promexio avatar May 09 '23 10:05 promexio

Any news on this?

promexio avatar Jun 05 '23 06:06 promexio

@promexio this will take some time, before I begin with this I need to tackle a bunch of other features and issues. Will update here when I begin with it.

18alantom avatar Jun 05 '23 07:06 18alantom

I built this #695 maybe that's something you might wanna look into.

erik-gross-hardt avatar Jul 14 '23 16:07 erik-gross-hardt

You might be interested in LiteFs https://github.com/superfly/litefs which does exactly that : replication of a SQLite database, although write requests should be forwarded to the master instance.

mildred avatar Aug 31 '23 00:08 mildred

+1 as I am using Frappe books on multiple devices synced using onedrive. It sometimes causes issues and conflicts.

njmulsqb avatar Jan 23 '24 11:01 njmulsqb