But this would only relate to local databases wouldn't it? Having to connect to a postgres server or something similar. The latency for queries would be far higher than using the file system.

That's orthogonal to the discussion, I think, you can also mount and access remote filesystems from any program as if it was a local filesystem.

Consider: a cheap VPS can have disk latency above 10ms while the in-datacenter LAN can be ~1ms.