NAS vs. Self-hosting server?

Discuss

Hello,

I am a bit confused bewteen the specificities of a NAS vs. a self-hosting server.

Several topics on the forum ask about mounting a NAS via a NFS share to a YNH server so that the former can be used as a data source for some apps (e.g. Nextcloud or media streaming apps) hosted on the latter, in a setup that takes 2 physical machines. For example:

What could be the cons of using only one machine for both local networks uses and self-hosting?
Here are 4 points I can think of, although I’d appreciate feedbacks in particular on the 2 last ones which aren’t so clear to me.

  • Data integrity: YNH doesn’t have at the moment out of the box advanced disk management features, as opposed to NAS OSes, cf. Concept/draft for managing several disks storage · Issue #1823 · YunoHost/issues · GitHub.
  • Service availability/performances: given hardware and network resources are split between local network usage and external services, it increases the load on the machine/network and may affect services’ availability/performances. All this depending on available resources and actual needs.
  • Cybersecurity: in case of security breach of YNH core or of an app, stored data might accessible to an intruder. But wouldn’t it be similar if the data source is external but shared via NFS (i.e. root access to the other machine would still give access to the NAS via NFS) ?
  • Local network access: If a service (say file storage or media streaming) hosted on YNH is called from the local network, will the traffic go out the local network to come in again, or will the traffic remain local?
2 Likes

Hello

I think the topic’s title you’ve choosen is not good. Why do you oppose nas vs self-hosting server? You can self host services directly on a NAS, without yunohost, or you can self host services on a simple server with or without yunohost or you can mix both. It’s almost a question of architecture, energy consumption, technical skills. There’s no best solution: each of one has its pros ans cons.

1 Like

My point here is precisely to better understand the pros and cons of one solution versus the other, and why you may want to have both instead of one (more particularly why you may want to have a NAS in addition to a self-hosted YNH server as in the example topics I provided).

A NAS is, by definition, a disk available through the local network.

So the NAS is intended for file storage.

A web server is not intended for file storage.

If you want to stream an audio file stored on your NAS in your house, through a media player, you can do it, without needing a web server.

If you want to share some photograph through a web server, you could do it without a NAS. Or you could do it with a NAS. It depends on what you need.

Now, about the pros and the cons :

if you want to share some data on you local network and to share other data on the web, you could use a NAS with different access.

your cons about disk management is wrong (I guess), because YNH is based upon a Debian, and this distribution manage well RAID disk.

About the performances : the limit of the performances are on web side… if you need to share media through the web server and if your media are huge (for example, 4k video), the NAS is not the solution. You should better look for a CDN.

Cybersecurity : if your server is corrupted, your NAS shouldn’t be the same, because, YOU SHOULD NOT use the same root password on different computer.
A read only NFS share will only be read, and no change could be made upon data stored on a NFS read only.

About the local network : it depends on your architecture. if you use the full DNS name of your web server to access your YNH server and you do not have an address translation for your domain name to local address, yes, the data might go out, and back to your local network.

Thanks for your feedback.

Yes I have in mind that both systems can somehow do all of that. Which is why I am a bit confused. Then how important here is the original scope of each system, if practically they offer the same thing? (open question here, not rhetoric).

Regarding disk management in YNH in particular, you can indeed do all of this in Debian, and therefore create your own custom setup of YNH with RAID, a specific filesystem, etc.. What I meant is that so far you cannot do it out of the box via the YNH interface, as opposed to NAS-s distributions (OMV, TrueNAS, etc.).

Good point for read-only mount from NAS to YNH for a media library for instance. But if you host Nextcloud for instance, I guess you may want a read-write mount to be able to remotely edit documents of your collection.

Typically I’m thinking of various machines behind a router.
So if one machine is launching a backup to/a media stream from the self-hosted YNH server on the same local network, can it be configured so that data are sent/read from inside the local network but that the YNH server is able at the same time to serve content via the web to other remote machines if requested ?

In that case, I assume you could let the data in R/W mode in the YNH server, and do a backup on the NAS, via a cron job planned on the NAS.

it should be defined in your local DNS server :

for example : you’ve got the domain name domain.ext
from outside, on the internet, nextcloud.domain.net should be redirected to your IP
from the local network, your machine is asking for nextcloud.domain.net and your local DNS should reply with a local IP, like 192.168.xxx.yyy

Ok thank you, so here is below a modified analysis summarizing above discussions on the differences and potential complementarities I understand between a NAS and a YNH webserver.

  • Data integrity: YNH doesn’t have at the moment out of the box advanced disk management features integrated to its interface, as opposed to NAS OSes, cf. Concept/draft for managing several disks storage · Issue #1823 · YunoHost/issues · GitHub. But given Yunohost is based on Debian, such tools could be installed of course.

  • Service availability/performances: When having only a NAS or only a webserver, given hardware and network resources are split between local network usage and external services, it increases the load on the machine/network and may affect services’ availability/performances. All this depending on available resources and actual needs (in the case I think of with few users and visitors, such kind of concurrence with a unique machine would not too worrying for me).

  • Cybersecurity: in case of security breach of YNH core or of an app, stored data might accessible to an intruder. In the worst case, if root access is obtained by the intruder then all data of the webserver is exposed. If the data is stored on the webserver, it can be copied AND destroyed by the intruder. If the data is stored on a NAS folder, mounted on the webserver with read-only permission, then the data, limited to this folder, can be copied but not destroyed. If the data is mounted with read-write permissions, then it can be copied AND destroyed, but limited to this folder. So depending on sensitivity of the data and how you share it, having both a NAS and a webserver can help addressing a cybersecurity threat model.

  • Local network access: It is still not clear to me whether, out of the box, all apps hosted on the YNH webserver (say file storage or media streaming), if called from the local network will see their traffic go out the local network to come in again, or whether the traffic will remain local. However in the first case, this can be addressed quite easily by customizing the local DNS server so that for a given URL, it points to the local IP of the webserver.