I beg to differ. The catch phrase "ZFS: the last word in file systems"
was never intended as a metaphor of a pile of crap (every single [bad]
feature ever invented on a stinking heap). If anything, the ZFS design
goals have clearly been to distill the top 10 (or so) *major* ideas and
implementing them _in the simplest way imaginable_
In the same way you don't criticize the minimalist design of a
micro-kernel for being decentralized (ha-ha) and creating too many
agents [1] to do the job that _one kernel_ could do...
In the same way you don't criticize a program written in in pure
functional style for not exposing clear centralized data objects for
external consumption...
Even in the same way you don't criticize the UNIX spirit for being
unfathomably clumsy (who can tell how this cut, head, grep and sed
business pipes into xargs?! "Way too complex!"? In fact, you should be
saying how elegantly trivial these components are. How exactly clearcut
their interface contracts are. How cheap to implement them. How
eminently testable (and therefore reliable) they are. etc.
----
I think it is the other way around. ZFS-es design is very simple (or
SUN would never have pulled it off in the timespan they did; they would
never have reached the reliability that they have notwithstanding the
fact that ZFS has the ambition to _replace_ the complexities of volume
management, block device abstraction, raid, versioning and transaction
control - notions that in their own right have taken companies decades
to implement and perfect; I could go on...). This is immediately
visible from the outside: simple CLI and raw _power_ that simply proves
that there is no logical barrier to the things they wanted to be able
to implement (when the complexity wins the designers out, the
compromises leak to the outside and show as the rotten limitations [4]).
Now the major issue is with GROKKING the design. And the key is simple.
You _do not_ grok the code. You _do not_ grok the implementation(s).
You must grok the design. If it looks complex, you are looking at the
code. You should be looking at the concepts and things like: "what is
the responsability of this thread/procedure/class" and "what processes
are running to cater for one pool; idem for filesystems and lastly for
the zfs kernel". It will become clearer.
Now the problems for us arise on the practical level:
- there is little in the way of documentation at that level.
- Also, SUN has a legacy of being extremely good at designing systems
to be massively scalable[5]. You can still see ext2/3 failing to
utilize all cores of the CPU to do its job (I know precious few file
systems that actually scale sideways in that respect[2]). It's trivial
to see why upgrading to 16-core will enhance your ZFS performance. This
is not complexity... it is simplicity (every process has such a
clearcut and small task, it is easy to just open a can of drones and
benefit from the cores in your system, flexible scheduling etc.). To
the SUN engineers the mapping of their 'normal design patterns' into
straight C code is - well - trivial. It is obvious where the locking
goes and why. They perceive the building as the chess grandmaster
perceives a middle game position: in logical chunks, not a thousand and
coincidences.
- That borders on the next contributing factor: for performance
reasons[3], everything has been coded in C. For size and deployment
reasons everything is part of some 5 separate 'components'. This
doesn't do justice to
the
separation of responsabilities. But the fact that it is not
immediately visible to the untrained eye does not mean that such
organization is not there.
----
In short: I love ZFS enough to baulk at the statement that it be too
complex. I'd like us to humbly admit that we
1. simply aren't smart enough
2. haven't got enough inside information/coaching
3. don't have the patience
4. have let ourselves be tempted and carried away by a thing of
technical beauty, thinking we can attack it with our normal pragmatic
programmer skills and attitudes; Excited we are jumping at hacking the
code. We assuming any code base should be hackable in days. In a way,
all traditional open source projects (perhaps even OO as a concept?)
seem to be that way and confirm the assumption. Thing is, ZFS is not
just any software. It is different. It makes sense that is not just
different on the outside.
I think we should be spending way more time analyzing the code. We
should be reading all (I mean all) the documentation out there. We
should be talking to SUN engineers. We should be reimplementing ZFS in
lisp. We should be designing new features. _Then_ we can see how
elegant ZFS is.
============ End of love letter ==============
I'd actually love to see what an implementation of zfs in haskell, lisp
or (why not) even Erlang would look like. I'm suspecting it would
suprise us how much 'simpler' the implementation would be, simply
because the implementation would mirror the design and concepts.
Put another way: ZFS might be a demonstration of
Greenspuns
10th Rule; we may be looking at an implementation of ZFS _on top
of_/_intermingled with_ a [6] lisp interpreter [7].
TL;DR: Put even more to the point for this rant: I'll happily accept
people complaining that this particular implementation of ZFS has a
steep learning curve (lacking the background of its creators). I refuse
to say that ZFS is complex. It's just not true;
Thanks for listening. I feel much better now :) Now if you'll excuse
me, I'll have to go and mock-up a be-all, end-all filesystem driver in
C# [7b] I've got the sneaking suspicion the performance could be okay
[8]
Seth
[1] cleverly avoiding the choice between threads, coroutines, processes
or your favourite alternative here (fibers?!?! eeck)
[2] I can't actually think of one now; I'm suspecting xtreemfs, cluster
filesystems, ufs and maybe btrfs might be examples; (the distributed
filesystems seem unfair examples as they have been forced into this
property by boundary conditions)
[3] and thank God they had portability in mind when writing ZFS
[4] splendid example: lvm2 (see e.g.
ZFS
vs XFS at serverfault recently)
[5] IBM on the other has had the focus on reliability and control;
performance suffers
[6] you don't say XML is complex because you couldn't even understand
the assembly listing of the non-validating parser.
[7] to keep the advertising police happy: but you can also shop at F#,
OcamL, Scheme, Lambda, Ruby, Arc, or have fun with
Ruby,
Javascript, C#, Fortran
or assembly. Whatever floats your boat. Just be prepared: expressing
elegant design in Cobol is gonna more of a challenge than doing so in
Scheme. However, if you are up to the job in Lisp, you can do it in
Assembly too (the complexity is not in the details). Jeff Bronwick:
that is you
[7b] yes
LINQ
queries are
monads
in disguise. Just don't tell anyone you got it from me.
You
didn't.
[8] Oh well, maybe I won't. I'll only end up confirming that it will be
a disappointment compared to ZFS. For the same reason that the Bazaar
codebase has much better coherence and "intent" than the Git
codebase... Still most developers will pick Git because... well it's
like the Ferrari next to a BMW. The BMW is comfortable, stylish and
accessible (and cheap). The Ferrari is a beast and harder to handle but
... well it is way faster and more fun. Confession: I still use Bazaar
because (a) it is more portable (yes it is) (b) it is good enough (c) I
haven't gotten around to get over the learning curve to switch to git.
Still I just _know_ when I do, I'll never look back. I do value power
over convenience.