Owncloud serve same file from multiple servers to single client

as I see that lan sync is somewhere on the development roadmap, I would like to ask, is there the possibility to go “sort of p2p”, meaning have 2 servers hosting and serving the same file to a single client?
this is the equivalent in practice to resilio connect with 2RO server peers and 1RW client peer with a consolidation job. but, with all the precious other features of OC :slight_smile: .

my situation is, I will have low power servers in different homes and would like to:
1- leverage the bandwidth of both connections.
2- have at the same time a “higher availability” decentralised system

is there a way to achieve this?

or a similar result, with a load balancing client side only for files that are aligned between the “main” and the “backup” servers?

I guess what you want is a cluster setup, although it seems a bit different of your ideas.

For a cluster setup, I think both ownCloud’s data and config directories must be shared among the cluster nodes via NFS (it might work with any other network-based FS). ownCloud’s code might be kept in each local machine, although it’s recommended that all the nodes have the same version of the code in order to prevent issues.
If you want to keep the config files in the host (not in the NFS), you must make sure the configuration is exactly the same in all nodes, otherwise things might break badly.

You might want to put a load balancer in front, so the clients hit the load balancer instead of any particular server.

The rest of the setup shouldn’t be any different.

hi Jvillafanez, thanks for your suggestions!

the cluster setup means I need a high availability load balancer server side, but the issue is that one of the locations can go offline, so also the load balancer could be unreachable (if I understand correctly).
I would need a load balancing solution client side – a paid cloud DDNS with load balancer is a good solution, but costs too much for my cheap build.
but still if I use load balancing client side, will actually OC work fine with that? I did not see any documentation on this with specific owncloud or nextcloud mention.
if I can get there, then it’s already going to be a good first step.

“Client-side” load balancing doesn’t make sense to me. The client cannot (and must not) assume that host A and B have the same data.

The load balancer is a part of the server infrastructure because it’s the server the one that can guarantee that host A and B access the same information. For the client there is only one entry point regardless of the complexity of the setup.

Now, as far as I know, the load balancer should be in a different (third) host. If either host A or B go down, I expect the load balancer to redirect you automatically to an active host.
You could put the load balancer in either host A or B, but if that host goes down, the load balancer will go down too. This is why a third host is advised for the load balancer.

In case the load balancer goes down, in practice it means that you won’t be able to access your data. You might be able to access directly to any of the hosts (A or B) but it might be problematic.
In theory, you could setup a HA load balancer (likely with additional servers) although I’m not really sure how.

Let me remark that the load balancer is part of the server’s infrastructure. A client doesn’t need to know if there is a host or a load balancer behind a url.

You don’t need two servers to have poor-mans LAN sync:
Run a DNS server inside your local network that resolves the domain name to an internal IP address.
While on the go the public IP address would be resolved and you’d still be able to access the same server over the internet. But once you are at home (or connected over VPN [with correct DNS server configuration]) the ownCloud server will be resolved locally and traffic will only flow via LAN.

This only works if you are self hosting on your LAN.

I call this poor-mans LAN sync, as the real feature other providers offer is some kind of P2P sync:

  • sync between clients on the same LAN

This is currently not possible with ownCloud and requires additional external tools. Anything would be possible, from a simple rsync script to something like syncthing. But be careful about hidden files inside the sync folders that are being used to describe the sync status.