We were thinking about building a virtual file system in SQL. There are several knowns 开发者_运维知识库ways of achieving file system like structures in SQL (Materialzed path, adjency lists ...).
After a while we thought of using NFS to store the directory/file structure and flat key value store to store custom attributes.
The directory/file structure on NFS would store ids only.
Dxxxxx1
Fxxxxx1
Dxxxxx2
Fxxxxx1
Fxxxxx2
Fxxxxx3
And a Flat table looking like this:
Dxxxxx1: {'name': 'mydir A', ... }
Dxxxxx2: {'name': 'mydir B', ... }
Fxxxxx1: {'name': 'file A', size: '', ... }
We would benefit from symlinks, mountpoint and UNIX permissions.
What are the cons of such an architecture?
The biggest one you might run into is speed issues with NFS. We learned here that NSF wasn't as reliable (random locking problems) and as fast as we needed. Do the volume/stress test before you commit to this architecture.
精彩评论