Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^4: RFC: Fuse::DBI - mount database as filesystem

by hardburn (Abbot)
on Oct 11, 2004 at 17:49 UTC ( [id://398229]=note: print w/replies, xml ) Need Help??


in reply to Re^3: RFC: Fuse::DBI - mount database as filesystem
in thread RFC: Fuse::DBI - mount database as filesystem

I'm not sure what problems you mean here, the only thing I can think of is your reference to symlinks turning a tree structure into a graph but I'd say that's a solution, not a problem.

Because the symlinks make your tree not really a tree anymore, but all the tools available want it to be a tree and often need modifications when symlinks enter the picture. For instance, should tar get the data from the symlinked file or make an entry for the symlink in the archive? The answer depends on various circumstances that cannot be coded into tar itself. The best tar can do is let the human operator decide.

Symlinks are useful and often necessary to express certain relationships in the filesystem. But the reason they are there is that almost everything outside of acadamia sees the file system as a tree and won't accept much else. They are a hack for a poor datastructure. A useful and necessary hack, but a hack. We'd do much better if we had filesystems that operated as a generalized set instead of a strict tree.

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Replies are listed 'Best First'.
Re^5: RFC: Fuse::DBI - mount database as filesystem
by fergal (Chaplain) on Oct 11, 2004 at 20:00 UTC

    I still don't see a problem, I'm unlikey to want to use tar on a virtual filesystem, I'd be better off grabbing a snapshot of the real data. Plus, the tar question is only relevent to files but in the scheme above the symlinks are always to directories. But as I said, this is not an interface that is particularly suitable to mass queries or updates, the tools one might use would not need to know anything about symlinks at all, for example

    perl -pi -e '$_=capitalise($_)' persons/*/name
    as a handy way of doing
    update persons set name = CAPITALISE(name);
    on a database without stored procedures or where I'm much more familiar with perl than with stored procedures.

    Mainly though I think it works best as an exploratory tool and that just requires following the symlinks to wherever they go.

    As for the tree/graph problem. If my data forms a directed graph then I don't see any problem. If the graph has cycles, then I want to see those cycles. Symlinks make that easy and if my data has cycles then my tools will have to know how to deal with that, whether they access it through an SQL interface or a filesystem.

    We'd do much better if we had filesystems that operated as a generalized set instead of a strict tree.

    I agree, although I'd imagine that we'll still be accessing those filesystems as trees. The difference will be that the tree structure will be dynamically created from the database.

    For a long time now, I've wanted to be able to do this

    > cd software > ls glibc.rpm DBI.rpm DBI.tgz DBD::mysql.rpm DBD::mysql.tgz author=/ format=/ language=/ ... > ls format= rpm/ tgz/ ... > ls format=/rpm glibc.rpm DBI.rpm DBD::mysql.rpm language=/ author=/ ... > ls format=/rpm/language=/perl DBI.rpm DBD::mysql.rpm ... > ls language=/perl DBI.rpm DBI.tgz DBD::mysql.rpm DBD::mysql.tgz ... > ls language=/perl/format=/rpm DBI.rpm DBD::mysql.rpm ...
    This is still a tree, the fact that the node "language=/perl/format=/rpm" has the same contents as the node "format=/rpm/language=/perl" doesn't make a difference, just as 2 nodes in a tree can contain the number 7.

    The truth is that trees are one of the best interfaces we have, in fact I can't think of any other good way of presenting a set of files (assuming the set of files is too large to just present as a list). It's also a pretty good way of storing the files on disk. The problem comes when you insist that the tree that's presented to the user sees must be the same as the tree stored on disk.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://398229]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2024-04-16 08:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found