I am thinking of running multiple database/messages servers such as postgres, redis, mongo, influxdb on old computers and use a centralized NAS to store the data.
One advantage is that I don't need to worry about getting appropriate local storage for the computers that host these services. For example, I could run postgres on an old desktop with spinning disks or even a raspberry pi.
But I am still concerned about the I/O speed and reliability. I wonder if anyone has experience doing it like this. Can you share the pros and cons? I really appreciate it.
Thanks, everyone. My motivation was to turn the many little computers with tiny or slow disks into servers by adding some centralized storage. But it looks like NAS today is not a good solution for this -- at least not yet. I appreciate all the insights.
If your NAS can keep up and your networking gear can keep up…. It might work for you.
You need to give a better info about what you have, what you want to run, and how you want to run it. How tolerant of data loss are you in there event of hardware failure?
I feel like if you have an excess of old machines and a NAS a kube cluster might be your next stop.
It's not a recommended topology (I/O perf & reliability), but if you do this, you'll want to use a "block storage" protocol (e.g. iSCSI, etc.), and a very fast network (i.e. 10Gbps min, ideally 25 or 40).
Putting your DB files on a NAS drive is like having a restaurant where the cook has to go 2 blocks down the street to get each ingredient, and put them back immediately after using them.
I don't need to worry about getting appropriate local storage for the computers that host these services
not sure I understand, what OS should these computers run? should this also be NAS storage? Or is it just the database filesystem that should be on the NAS?
honestly it looks like you don't have the knowhow to setup shared storage, it seems you are more a developer type of person, so KISS (Keep It Simple Stupid)
run local storage, your databases won't be even gigabytes in size, get some cheap SSD drives instead (SATA) if you want I/O.
also all your databased won't dive when your accidentally pull the power plug to your NAS or trip over the ethernet cable.
You can compensate the higher latency with keeping most or all of the database in memory (at least with postgres or mysql) aka caching. This will help you with database reads but not with writes. Writes need to hit a persistant storage layer first.
When it comes to reliability I usually rely on the replication features shipped by the DBMS.