16 de julio de 2009

Sobre ZFS y btrfs

No se pueden imaginar las horas que me he pasado googleando y leyendo en busca de las diferencias de btrfs respecto a ZFS y las ventajas o desventajas que tienen. Aparte de la idea de "punteros inversos" de btrfs, y su sfck, no parecía haber ninguna más. No es tan fácil encontrar datos, al ser tan nuevos aun no se ha escrito mucho en detalle sobre ellos. Por eso me ha agradado encontrar por fin algo leyendo esta entrevista a Valerie Aurora, desarrolladora de sistemas de archivos en la nómina de Red Hat, donde dedica un par de párrafos a describir esas diferencias. Pero lo más importante, y lo que la concede autoridad extra, es que tambien fue empleada de Sun y co-desarrolladora de ZFS durante dos años. Sabe, por tanto, de lo que habla, y su posición es más neutral que la de otros:

"ZFS and btrfs are similar in structure and goals in a lot of ways. Features they share are copy-on-write everything, checksums, writable snapshots, storage pooling, simple administration, ad nauseum. More interesting are the major differences in architecture. At the highest level, ZFS uses plain ol’ trees of pointers to blocks, FFS-style, and variable block sizes, inspired by the SLAB kernel memory allocator. Btrfs uses a specialized, COW-friendly form of b-trees (as presented by Ohad Rodeh at LSF ‘07) and extents. Btrfs is actually slightly more exciting than this: every single piece of data or metadata in btrfs is an item in a b-tree, and items are packed together indiscriminately, without regard to their types. ZFS reduced all file system metadata and data to objects and related operations; btrfs reduced them all to items in a b-tree. Now all the interesting decisions are about how to assign keys to items and order them inside the b-tree.

Now for personal opinion/zealotry time. Initially, I thought the ZFS approach was the simpler and cleaner - at the time, the code to manage b-trees and extents was complicated enough, and adding copy-on-write and checksums to that made your brain want to explode. It took Ohad Rodeh’s simplified, robust b-tree algorithms and Chris Mason’s everything-is-an-item insight to change my mind. I’m a convert."

1 comentario:

  1. Con tener fsck ya me vale para elegir Btrfs.

    ¿tratar todo como items en b-tree tendrá un impacto en el rendimiento en el futuro? En cualquier caso me gustan los programadores que son capaces de cambiar su opinión sobre un diseño y no son fanáticos hacia sus anteriores trabajos. Muy interesante.

    ResponderEliminar