Cross sync between multiple NAS

WhiteTiger

Explorer
Joined
Jan 2, 2014
Messages
86
I describe to you a scenario between three NAS that is only apparently complex.

There are 3 houses with a firewall and a VPN to the other 2.
Dad's house towards Lucy's and Peter; a third between Peter and Lucy's.

In every house there is a NAS named Dad, Lucy, Peter.
All NAS have this folder tree:
  • \Work\dad
  • \Work\lucy
  • \Work\peter
  • \Work\common
I want there to be synchronization between all the NAS so that they always have the same updated folders.
Sync, for example, always starts at minute 30 of every hour.

Now the problem is only with the "common" folder because it is the only one that is used by everyone and where there are files and DBs that can be used by all 3 people.
For simplicity we ignore the fact that files can be "open" and can therefore always be replicated.

Furthermore, it may happen that for some reason a VPN is not active, but in the meantime the NAS is always used.
So, when the VPN is restored and with the subsequent Sync there will be a new update of all the modified files.

Let's imagine now that between 10:00 and 11:00:
  • VPN between Lucy and Dad is UP.
  • VPN between Peter and Dad is UP.
  • VPN between Peter and Lucy is DOWN.
On the file \Work\Common\A write at the following times:
  • 10:10 Dad
  • 10.15 Peter
  • 10.20 Lucy
At 10:30 starts the sync between Lucy and Dad and Peter and Dad's .
Again, on the \Work\Common\A file they write at:
  • 10.45 Lucy
  • 10.50 Peter
At 11:00 the VPN between Lucy and Peter restart; so, all sync are restored.

What will be the result of \Work\Common\A on the 3 NAS after these syncs?
I assume that the files will always be synchronized (even after the 10:30 sync), even without the VPN between Lucy and Peter.
Do you agree with this assumption?

In this context I then ask myself in which context the synchronization of a file or a DB occurs with granularity, i.e. not at the level of the entire file, but only of the changed part.

Thank in advance for any advice.
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
In this context I then ask myself in which context the synchronization of a file or a DB occurs with granularity, i.e. not at the level of the entire file, but only of the changed part.
Almost all other tools you will use other than ZFS replication won't be doing block-level replication, rather file synchronization using some kind of key like modified time or file size or a combination of those to determine if the file needs to sync.

Multi-way (or even two-way) sync is always going to be problematic if editing happens at any time to the same files from any replica, creating conflicts that need to be resolved by software rules or human brains.

Services like Office365 offer simultaneous edits into the same files and management of the changes is done by routing all access to the content via the same online service, not via separate editing of independent replicas which then need to be merged later.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
*cough* git *cough*

Sparkleshare might come close to a working solution.
 

WhiteTiger

Explorer
Joined
Jan 2, 2014
Messages
86
@sretalla
Being 3 TrueNAS SCALE I could therefore manage the Sync ZFS, right?

@Patrick M. Hausen
I don't know, how could I activate it? With an App?


Years ago, in the company where I worked we used Lous Domino 8; It doesn't matter whether the changes were in an email, a comment, or a single field of a database. Replication was always across 9 servers and 50+ clients.
I was looking for something similar.

Office365 requires a license. I bought it a year ago and I don't think I've created more than 10 documents.
I didn't renew it this year.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Sparkleshare? Go to sparkleshare.org and see what they offer - docker, possibly? One of these experimental LXC jails on SCALE for manual installation? I only mentioned it because it is built on git and git is the only software I know that supports n-way merges that are not completely dysfunctional.

I would set up a single central system running Nextcloud and be done with it, to be honest.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Being 3 TrueNAS SCALE I could therefore manage the Sync ZFS, right?
The destination of a ZFS sync is read-only. ZFS sync is one direction only.
 

ChrisRJ

Wizard
Joined
Oct 23, 2020
Messages
1,919
What about Syncthing? It works with local copies (like OneDrive), if that is ok
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
I was going to say syncthing - you can run it as an app on each NAS. It will sync in near realtime. The biggest issue is if 2 people edit the same document - at which point you will need to manually sort out the consequential error messages
 

Kailee71

Contributor
Joined
Jul 8, 2018
Messages
110
Why not run just a single server and have this exposed directly through your firewalls to the three sites using wireguard or similar? Then use one (or if you're paranoid two) of the others as backup, but not as production servers. Is bandwidth an issue?
 
Top