I have done this and it can work; that is, you can put a Photos library file on any volume that mounts in your filesystem and Photos will open it. I have used a Synology NAS and Dropbox folders. However, I found that the experience was brittle- Photos does a lot of processing of photos in the background, for face detection and other things, and if the remote volume becomes unavailable unexpectedly then you will get some corruption of the Photos database. Over time, I saw increasing occurrences of missing/incorrect thumbnails, metadata that would not save, and outright image changes.
I stopped doing this around the time I upgraded to macOS 12, so I haven't tried it with the most recent versions of Photos and macOS. And my diagnosis of "database corruption" is somewhat speculative. YMMV. But I recommend putting some effort into making sure that Photos is not working when you take the laptop out of the house, for example. And you will have to look for its background processes, not just quit the application.
My current solution, similar to the link in your question, is to use multiple smaller Photos library files, and to archive older files on external USB harddrives. I use PowerPhotos to manage the libraries.
I also did the same thing with iTunes libraries, and again, you can put the iTunes (Music) files on any mountable volume. You can also put the actual music files on a remote volume and keep the Music database files on your computer, and multiple Music databases can point to those files. But if the remote volume is ever not available when Music looks for it, it will assume it is gone and create a new default folder for music files, and it will appear that all your music has disappeared. In my case, I was trying to make the music available to multiple people in the house, and I had a few complaints from my wife saying that "all her music is gone". So Home Sharing is more convenient and reliable for that for me.