Is there any way to host 3 identical file servers in 3 different locations, and have clients automatically connect to whichever one is closest? reddit / selfhosted ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 02:01 Im wanting to replicate the files on my home server to my server at my business and a VPS. Then have it setup in a way where my laptop, iphone, etc... will automatically connect to whichever server is closest or fastest. Clearly the servers would sync amongst themselves so they all 3 stay up to date. Is this even possible? ---------------------------------------------------------------------- _martinboca_ · 2023-10-31 02:07 !RemindMe 1week ---------------------------------------------------------------------- crysisnotaverted · 2023-10-31 02:11 Surely it's possible, but what is the advantage of selecting the closest one? Are your bulk file transfers heavily impacted by a few dozens of milliseconds of latency? ---------------------------------------------------------------------- dtuando · 2023-10-31 02:15 How far is work from home that you need a second copy closer to you, and what is it your serving? And what's the third VPS copy going to be for? Because unless you live in one of the major cities where the data center is located not sure if it will make much difference from your home copy or work copy unless there are some bandwidth restriction I'm unaware of. I'm unsure of what type of data needs to be redundantly copied unless it's backups or something? ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 02:17 No it's the fact that I'm shooting a lot of ProRAW footage, and to try and be cheap I only got the 128Gb iPhone so it fills up insanely fast. Im wanting to setup an automation that will upload videos automatically when they are taken and then delete them from my phone. I have the automation working, but my home internet is slow as dirt. ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 02:20 Not far, but 2 different ISP's and my home internet is slow as dirt. We have fiber Coming Soon™ to my area but no idea when. ---------------------------------------------------------------------- diego-ch · 2023-10-31 02:22 iPhone 15? Just get a Samsung T7 SSD and connect it via USB type c ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 02:24 Not yet unfortunately, I'm on the 14 Pro, otherwise I'd just get an SSD. ---------------------------------------------------------------------- arankwende · 2023-10-31 02:33 Just curious, how did you setup that automation? ---------------------------------------------------------------------- Zestyclose-Run2406 · 2023-10-31 02:36 Unless your vps has unlimited storage I'd be weary of that when it comes to pricing and uploading raw photos or video. It's not like you're working with jpgs here. Have you looked into a NAS and cloud storage? ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 02:39 It was a huge pain lol. It also relies on the fact that I use a 3rd party camera app that lets me add metadata to any files it creates this way my shortcut can search that tag to find what it needs. ---------------------------------------------------------------------- dtuando · 2023-10-31 02:42 Have you tried synching? ---------------------------------------------------------------------- crysisnotaverted · 2023-10-31 02:43 You should just have the iPhone clone to the server with the highest bandwidth, then let it trickle down to the other 2 servers via your favorite flavor of replication. ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 02:44 I have since there is an iOS app for it now. But just like on other devices there is no selective sync. So the files will sync, but then they’re still on my phone too. ---------------------------------------------------------------------- MeerkatWongy · 2023-10-31 02:51 Buy Synology (or equivalent) NAS boxes and place them in 3 different location. Their ecosystem will allow you to sync files. A bit pricey but not sure on connection bit like which client will connect. ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 02:52 Funny enough i have a Synology at home and work. Unfortunately theres no way to tie the two together like that. Even if I setup high availability it’ll only use the “primary” nas unless it goes offline ---------------------------------------------------------------------- athornfam2 · 2023-10-31 02:59 Nothing I can think of that’s non enterprise. Typical file server with DRS/replication and a CNAME. ---------------------------------------------------------------------- Gabe_Isko · 2023-10-31 03:03 No need to overthink it. Bucket storage with replication is your friend. For closest location, you will need some sort of DNS resolution service. You can host your own with MinIO. Having said that, this is something that I would definitely want to compare to cloud service pricing. S3 plus cloudfront will do this very well, and you don't have to worry about managing anything and can stop paying when you are done syncing this data. I think it is definitely worth looking into, even if it isn't self hosted. ---------------------------------------------------------------------- mpopgun · 2023-10-31 03:54 Google Photos has a backup feature...once they upload off your phone you can delete them from your phone and they'll stay on google drive. Then you can use something like rclone, or to copy them out of google drive onto your local servers and free up the google storage. I think Onedrive has the same backup feature too for photos. ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 04:18 Ok this I am very interested in. Would you be willing to elaborate a bit more on how I would go about doing something like that? I already have the data in question stored in a Backblaze B2 bucket. If I could host MinIO at home and work then setup someway to keep them synced and allow my devices to pick the closest server that would be perfect. I was also looking into Ceph but haven't had the time to really dig into weather or not it can help in this case...or how to use it lol. ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 04:20 Thats my goal, but which one has the highest bandwidth, depends on where I am, and I was hoping there was a way to make the decision automatically. ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 04:24 Immich is awesome, I've been keeping an eye on that project for a couple years now. Though it's not what I'm looking for in this case, my goal is to have my raw footage get off my phone as fast as possible without having to remember to lug extra stuff with me. Then have it ready to go into Davinci Resolve on my editing rig. ---------------------------------------------------------------------- mpopgun · 2023-10-31 04:30 What would you lug with you? It backups over the wifi to your severs. It's just an app. ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 04:34 Oh sorry, that wasn't in reference to your comment. Just saying that my current solution is to bring a drive with me. I use a 512GB USB3.0 flash drive and a lightning to USB adapter. It works...if I remember to grab it...and if I remembered to empty it from last time before I grab it. lol ---------------------------------------------------------------------- JoeB- · 2023-10-31 05:09 I believe for clients to automatically connect to the closest server, you’ll need a Content Delivery Network (CDN), like that offered by Cloudflare. I’m not sure if this is something that can be self hosted. ---------------------------------------------------------------------- crysisnotaverted · 2023-10-31 06:05 >which one has the highest bandwidth, depends on where I am Does it really, though? As a normal user, you won't be running out of bandwidth from the fiber backhauls and backbones that make up the network. Your main limitations will be the uplink from your phone to your cell carrier, and the downlink from your ISP to your NAS. Like, it should really matter where you are. Your phone upload and your NAS download speeds are your real limitations. ---------------------------------------------------------------------- iamdadmin · 2023-10-31 06:06 Easy. Set up a local DNS server on each of the three sites, so when you are there, it has a record like "fileshare.lan" or something pointing at the local IP, point your iPhone at fileshare.lan and it will send to the local one. ---------------------------------------------------------------------- Gabe_Isko · 2023-10-31 06:50 [https://min.io/docs/minio/linux/administration/bucket-replication.htm l](https://min.io/docs/minio/linux/administration/bucket- replication.html) [https://min.io/docs/minio/linux/administration/bucket- replication/enable-server-side-one-way-bucket-replication.html](https: //min.io/docs/minio/linux/administration/bucket-replication/enable- server-side-one-way-bucket-replication.html) Idk how compatible B2 is for normal bucket operations. These mostly are patterned off of S3 compatible commands. B2, I would assume, is probably more geared towards back up purposes than being general cloud storage. But if everything works with B2, it should be what you are looking for. I am not sure how you would pick the closest server if you are out and about. My mind immediately goes to some sort of DNS rule or something. But do you really need to always pick the local one, or will you be on the local network for the upload? Also, you are always going to get better perforance uploading it to cloud storage from a managed service. You can think of it almost like a cloud based cache that then replicates to your local bucket. You can even have the data delete itself using a life cycle policy. I have never used ceph. My understanding is that it is a clustered solution for setting up a service that can do this sort of stuff. That would be important if you are trying to architect a scalable service that provides buckets for your needs on demand. But what is nice about MinIO is that you can just run it in a container and it is ready to give you a bucket. This is bad if you have a team that needs to constantly create them, but you really only need to host 1 or a handful of buckets. MinIO is what I reach for whever I need to set up a bucket on my homeserver for a task. I usually just end up removing it when I am done, easy peasy. Someone let me know if you can use Ceph like that. ---------------------------------------------------------------------- ElevenNotes · 2023-10-31 07:01 Anycast via BGP. ---------------------------------------------------------------------- grizlipiprim · 2023-10-31 07:13 Syncthing can do that, but I don't know if it's available for iphone. Your can not define a preferred server based on your location but you can disable the slow one manually. And Syncthing features local sharing. If you're in the same wifi as your current server, files will be offloaded pretty fast. Sync between all three servers will be handled by syncthing automatically. Fire and forget. ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 07:22 ooooh I hadn't considered that. ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 07:33 >Idk how compatible B2 is for normal bucket operations. From my understanding B2 has complete S3 API. The only place I have used it though is on my Synology in Hyper Backup, and thats been running for years. Any other time I access other buckets on B2, it's using something with B2 specific support. >I am not sure how you would pick the closest server if you are out and about. My mind immediately goes to some sort of DNS rule or something. Basically my thought would be this: * If Im home, point to home server * If Im at work, point to work server * If Im at neither then point to B2 But the hope is to setup one app with one address and use some kind of rules (sounding like DNS is the answer) to automatically point to the right server. ---------------------------------------------------------------------- iavael · 2023-10-31 07:37 Is case of single tcp connection it usually does. Read about bandwidth-delay product and how it affects tcp performance. ---------------------------------------------------------------------- tech2but1 · 2023-10-31 07:59 > Unfortunately theres no way to tie the two together like that Quite the opposite, there are multiple ways to do this with Synology. I have this exact scenario in place on multiple sites using multiple methods. ---------------------------------------------------------------------- tech2but1 · 2023-10-31 08:01 > B2, I would assume, is probably more geared towards back up purposes than being general cloud storage. Not specifically no. It is S3 compatible and is geared to be used for backup/replication/as a CDN etc. It isn't a second rate service at all. ---------------------------------------------------------------------- tech2but1 · 2023-10-31 08:04 You would need to use an actual FQDN so it would work on the internet too. You would just add a DNS entry to your domain (forwarded to your B2 bucket in this instance). ---------------------------------------------------------------------- lilolalu · 2023-10-31 08:20 Google "geolocation based load balancing" for your proxy server. The file syncing for the backend is easy, i.e. you can run a rsync script that syncs on file change. https://www.abrandao.com/2023/03/how-to-rsync-between-two-folders- automatically-on-file-changes/ ---------------------------------------------------------------------- patg84 · 2023-10-31 08:42 I was gonna say, even with qnap there's a sync app that will move data around between multiple sites and or cloud storage. ---------------------------------------------------------------------- iamdadmin · 2023-10-31 10:03 Yes true, I hadn’t considered that one is a VPS on the internet. Still the local overrides would work for the two local servers! ---------------------------------------------------------------------- PaulEngineer-89 · 2023-10-31 10:38 Cloudflare. You just turn it on and use them as your reverse proxy. ---------------------------------------------------------------------- PaulEngineer-89 · 2023-10-31 10:43 Here is the problem you face speaking very generically. If you cache everything on the clients access is fast but storage is an issue. If you cache on the LANs speed is an issue. You can try to store on an internet VPS but storage costs are high. You can cache just the index, “Google Drive” style and download/cache only as needed. This probably works the best because you control it down to the file level and speed is not an issue because you work iff local copies. Otherwise any scenario is going to be up against the bandwidth problem. ---------------------------------------------------------------------- kahnii · 2023-10-31 11:29 This. I was searching for this answer. Syncthing: open source, p2p, very efficient and I've found apps for all OS I'm using (Linux, Android, Windows) ---------------------------------------------------------------------- PipeItToDevNull · 2023-10-31 12:48 This would be done with DFS and DNS on Windows Server ---------------------------------------------------------------------- Gabe_Isko · 2023-10-31 15:41 Yeah, I don't know too much about it, and have never used it. I was reading a review that was saying it is more geared toward backups and that they throttle download speeds, but that might be other BackBlaze offerings. They definitely offer it to support their backup business - you back up a lot of data these days with lifecycle policies. I mean, I have heard good things about B2, just not that it is a complete replacement for S3 in all applications. But if it works it works. ---------------------------------------------------------------------- tech2but1 · 2023-10-31 15:51 I don't think I'd read too much into a review from someone who has clearly never even bothered visiting the B2 homepage. Unless you are confusing Backblaze Computer Backup with B2 Cloud Storage? ---------------------------------------------------------------------- Gabe_Isko · 2023-10-31 17:45 The only time I ever looked at B2 is because I researching backup options for a personal project, and noticed that Backblaze also does object storage. I would imagine this is how most people find out about it - Backblaze is a backup company, that is what all their adds in Critical Role are about. It makes sense; the modern approach to a lot of data retention is through a lifecycle policy on bucket storage. So it makes sense for them to branch into that kind of offering. The truth is I don't know what the pros and cons are, or of B2 is viable as general use. I have only really used S3 for work, and MinIO at home. There are a ton of object storage providers - might as well shop around. ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 21:15 My bad, I was referring to no way of automatically switching between servers, not that theres no way to sync multiple servers. ---------------------------------------------------------------------- RoleAwkward6837 · 2023-10-31 21:20 Are there any linux alternatives? All my servers are linux, BSD, or Synology. Im not a fan of Windows, especially with how expensive Windows Server can be.