Who Needs Git When You Have ZFS?
zef.me
zef.me
Do not try to snapshot a running database though. Before you execute the snapshot you should make sure everything is flushed to disk. For example with PostgreSQL you need to create a checkpoint before the snapshot, so you write:
SELECT pg_start_backup('prepare_my_snapshot');
AND when the snapshot is done:
SELECT pg_stop_backup();
Is a database (or anything else) really supposed to behave that way? Shouldn't every state along the way be possible to resume from? In particular, shouldn't database transactions take care of this?
The fine print: Due to the architecture of file system access in contemporary kernels (esp. file system caches), it's next to impossible for a user-space application to actually guarantee that writes are durable (i.e. synced to disk at a defined point in time), but most RDBMS manage well enough in practice.
While this doesn't relate to a specific file, you can always look at the size of Dirty and Writeback in /proc/meminfo. They correspond to the amount of dirty file page caches that have yet to be synced.
The problem is that production RDBMS tend to span multiple volumes, e.g., for logs vs. data to pick a simple case. FS snapshots in this case may not be consistent which would cause recovery to fail.
AFAIK this is why even robust RDBMS like MS SQL server use mechanisms like VSS to ensure data are flushed, which guarantees not just crash consistency but application consistency.
When this snapshot is taken you can send & recv the diff to a remote backup server.
As for flushing the database first, it is unnecessary as long as the database is ACID compliant. If you use MySQL, you will probably want to freeze and flush the database first to be absolutely certain of safety. DDL statements and a few minor other things in MySQL are known not to be ACID compliant.
Yes, but that's the point
You're right about LVM though
>You've been able to do this for years on Linux with LVM anyway.
What's the point of saying this in that tone? I could achieve the same goal in a number of different ways - that doesn't make any of those methods invalid because another one exists.
Also, the discussion is centered around ZFS, there's no reason to bring up LVM. Everyone knows there's many ways to skin this cat and it doesn't make anyone appear any smarter because they know of one way.
When I was a contractor at IBM in the 90's we had something similar so we could work on OS/2 source code. The entire build project was made up of hundreds of other sub projects and it was way too big to fit on a single developer machine of the time. Plus the reality was that individual developers only edited small portions of any part, even though they needed the whole to build and test.
In later years, I've found myself thinking about ZFS for other big project scenarios. Like legacy enterprise websites that have gigs of static files and scripts that integrate with parts of webapps, etc. it's a pita to sync an 80gb mirror to every dev and a horrible waste of space. Much more efficient to simply mount the production mirror once and then store small edits locally.
Note that these kind of legacy sites are usually not checked into source control because they are too big.
What's the pro/con of zfs compare to docker?
I'd be really curious to see some actual numbers on this though.
https://clusterhq.com/flocker/introduction/
The ZFS version is not yet considered a production release due to delays in stabilizing the /dev/zfs API though.
Is ZFS any better than Btrfs in this regard?
The proper way of doing this is to clone the snapshot and then spin up a new container using the clone. That way you do not need to risk downtime on your production code. I believe that Delphix has a ZFS-based solution for doing this.
Might not be really feasible. In order to create a consistent snapshot you have to stop the database server (or, if running a multi-master setup, take one master out of replication, but MM setups are rare and even more so is experience with them).
Then, you have to actually do the clone - with a couple-GB-sized database, that's easy and fast but once you hit triple-digits GB sizes, you'll end up with a massive disk performance loss during the copy.
Also, in case your DB upgrade went through, you have to (magically) apply it to the other servers because in the time between clone-begin, clone-end and db-upgrade-end data will have changed on the prod system...
It's easier to make a short maintenance window, do a snapshot, hope for the best and if it blows up, restore service with a single click (by removing the maintenance page).
Also, if you need to stop the database for a consistent snapshot, then your database is not ACID compliant.
> Notably missing is support for merging
So, it's almost like a car except it's missing its wheels
No, it's not like Git
I mean, it's a cool tool; I use it on my NAS (particularly like the ECC mode instead of dumb RAID), but the git-equivalence aspect looks a little bit like a flamebait ;-)
zfs allow zef mount,create,destroy,snapshot,rollback,diff,clone,send,receive mypool/projects
Now he doesn't need sudo in front of most of them.> Using ZFS as a replacement of Git for is probably not a good idea, but just to give you a sense of what ZFS supports at the file system level, let me go through a few typical git-like operations:
Then maybe it shouldn't have a purposefully click-baitingly title suggesting it does...
> Then maybe it shouldn't have a purposefully click-baitingly title suggesting it does
I normally hate clickbait, and yet I liked this article and its headline. Maybe because the tone was self-deprecating, like me getting on a bicycle and saying, "Look out, Tour de France!"
Actually, it's like a fish getting on a bicycle and jokingly saying, "Look out, Tour de France." Maybe the fish isn't anywhere near good enough on a bike to compete in the Tour de France, but still, it's a fish on a bicycle.
In the same way, Git will run circles around ZFS as a source-code version-control system. On the other hand, it's way cool that ZFS can even do some of these things, because after all it's just a filesystem.
One problem that didn't really occur to me before I became more ops-side was that administrators would want to heavily restrict / remove users' (read: developers and even other sysadmins) abilities to create snapshots in the first place. Why would you remove self-service temporary backups and avoid a lot of backup restoration requests? I didn't realize that other engineers could be careless and keep dozens or even hundreds of snapshots over time that gobble up expensive storage resources (SANs are not cheap regardless of manufacturer) and slow down I/O transactions over time. That was why so many of my customers deploying stuff like VMware Lab Manager and vCloud Director demanded the ability to remove access to snapshot features.
As a result of the typical usage where user abuse of a very powerful feature threw things for a loop, the typical organizational structure and siloization of these environments means that nowadays SAN-side LUN snapshots are used more often than from the VM layer (the same administrators that manage VMware environments typically have rights to the SANs). Using ZFS like this is a developer-side reaction to me, but duplication of trying to solve the same problem when technical solutions have existed and are viable is exasperating.
Incidentally, I'm also a fan of nested virtualization and using git on top of ZFS... I believe all of these tools complement each other nicely as opposed to being mere repetitions.
On the other hand, recursive snapshots in ZFS are really slick and can achieve 90%+ of what people typically want from VMware-based snapshots when it comes to any non-Windows OS if there's a little room for not needing to care about indirect changes required in rollbacks.
So, no replacement. Merge and Branch are the major features of git. The bigger the project the bigger the need for these. I know some projects where people work full time as merge conflict resolvers. Without git that would require a whole team instead of a person.
I actually think the git object store is very clever. ;)
That insight is critical, especially now that we are heading towards Dropbox Infinite, IPFS, Ceph and so many other non-centralized file systems.
Syncing is not a solved problem at all yet. Advances can bring the same revolution as 3-way merging did to SCMs, previously dominated by file-locking mechanisms.
Of course, I'll take reliability & stability over fancy features any day, but I'm glad there's active development in this area, and look forward to seeing these features mature. They could contribute to some interesting simplifications.
That is why people use ZFS and OpenZFS, they are battle tested and very mature.
ZFS is in use in production systems all over the world, with a very good reputation for reliability and stability. Nexenta and others have made successful businesses working with large enterprise customers selling ZFS based storage solutions.
That's why you need to stick with Git.
The point is, Oracle have decided to sue once over usage of something they bought and may do so again in the future.
The legal situation of Google's use of Java APIs was always a tiny bit murky, but it was super-clear-cut compared to the use of ZFS-on-Linux.
Here is a legal opinion on the matter:
https://www.softwarefreedom.org/resources/2016/linux-kernel-...
And here's to hoping that ZFS becomes so widespread that Oracle themselves end up redistributing it in their version of Linux, like they did with DTrace.
Of course not.
Somebody further down mentions art assets. Also potentially relevant are document repositories.
ZFS isn't very easy to use for a lay person, but that's really only a "Time Machine"-esque front-end away.
Well, you need to install the user package 'zfsutils-linux' and you are ready to go.
The kernel modules for ZFS are already in the default kernel and are loaded automatically when you create a volume.
I check on it every year or so, but my impression is that ZFS on Mac is still so far behind where ZFS is on FreeBSD and (more recently) Linux, that it isn't really clear whether ZFS will ever work reasonably on the Mac.
(I would love to hear experiences of people actually using it on OS X, though! I may be out of date.)
As the article notes, ZFS on Linux has been production-ready and stable for over three years. For in-depth info see [2].
CDDL is an open-source licence just as the GPL.
But incompatible with the GPL, which mostly explains the current situation of ZFS on Linux.
Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. The Modifications that You create or to which You contribute are governed by the terms of this License.
If you distribute source code, this license means that you must use this license. You can't use some other license, as its not compatible with the distributor deciding what license to use. CDDL license require that any source code distribution use CDDL as its license, and it is incompatible with any other license that has similar condition. CDDL is incompatible with GPL because GPL has similar conditions as CDDL.
If we were to make an identical copy of the CDDL license and call it CDDLv2, those two identical twins would be incompatible with each other. Software under CDDLv1 would not be permitted to be combined with software under CDDLv2 and distributed as source code.
There is a CDDL v1.1 that is effectively 's/Sun/Oracle/'. The CDDL has an optional clause saying any later version is allowed and the CDDL only applies at the file level. I have yet to see a problem in mixing CDDL code under v1 and v1.1 with each other.
If CDDL did not have their condition that source code is only made available under CDDL license, then the incompatibility would not exist. If GPL had similar loophole as CDDL and permitted modifications to be under different license if they are put as a separate file node in the file system, then the two permissions would permit a single project to include software under both licenses. I doubt CDDL will receive such update, and there is already LGPL.
The loophole is quite interesting from a legal point of view. Would a filesystem based on a database be fine? The computer would be storing all the code in a single file, but the presentation would look like that file is actually two different ones. Same goes with a gz file and "virtual" file systems, that present data inside as if it were separated files on the disk. What about a container image where a single work has source code under CDDL and source code under some other license?
I guess it wasn’t a half bad resource when it came out, but these days there’s got to be better blog posts about this, right?
EDIT: Not that I’m bitter; I love zfs. I mainly wonder how something so old ended up here.
Edit: Perhaps the ZFS to Git comparison is itself novel? I would like to read about other filesystem features (any file system) from this perspective because I think I would learn a lot.
Don't get me wrong, I looove ZFS, and from a quick scan this article looks like a good intro to ZFS, particularly for someone familiar with git.
> Of course, I'm not seriously suggesting you'd ditch a "proper" version control system, but it gives a good sense of what's possible at the file system level.
ZFS and git are complementary technologies. One does not replace the other.
E.g. the examples show branching but not merging.
On the other hand, this might be useful for storing binary large files that are not really diffable and mergeable, and thus a bad fit for Git. However, the typical use case for this is art assets in games, which means that it's the artists and designers who are the target audience. Git is often said to be too difficult for non-programmers, and ZFS or BTRFS is definitely not easier.
Relatedly, ZFS's memory management relies on the assumption that a forked filesystem and its sibling will monotonically alias less data as either is modified. This allows it to avoid tracing and ref-counting alike, but makes implementing merging or `cp --reflink` difficult.
Unlike linux where there's a separate /boot, OS X doesn't really separate boot from root file systems. So how you'd boot XNU from HFS+ and transition to a separate ZFS root fs isn't obvious to me from the existing documentation.
https://insights.ubuntu.com/2016/02/16/zfs-is-the-fs-for-con...
Is $60/TB/month competitive?
ZFS can be good cms choice for large binary files.
"Of course, I'm not seriously suggesting you'd ditch a "proper" version control systemOn the other hand, if you want a supported filesystem with many of the same features as ZFS, there's btrfs. It alleviates all of the problems with the ZoL port. And there's no fear of Oracle lawsuits.
https://github.com/zfsonlinux/zfs/commits/master
I will admit that my contribution activity has been low as of late, but it will pick up again soon. As for the bug list, that is because basically all distribution problems get sent there and duplicates are not closed until it is proven that they are duplicates. There is no such transparency with other filesystems' bug tracking. Redhat receives plenty of bug reports through Fedora that they happily close if not solved by EOL.
As for btrfs, one of the btrfs developers claimed that ZFS has 5 times the development resources of btrfs:
https://news.ycombinator.com/item?id=11749477
As for lawsuit fears, the fact is that using any software at all puts you at risk of a lawsuit. Whether or not the plaintiff has a legitimate case is a separate matter. However, if we consider the prospect of Oracle having a case against those using btrfs or ZFS, btrfs would be at higher risk. The CDDL provides an implicit patent grant while the GPLv2 does not. Any ZFS patents that are applicable to btrfs that Oracle accquired from Sun could be used against those using btrfs. The repercussions for Oracle would be huge, but if we are discussing about the potential for legal issues with Oracle, then btrfs is at the greatest risk.
From what I know of the internals of the two, btrfs has far more problems. This shows some of the problems on an enterprise distribution:
https://news.ycombinator.com/item?id=11749010
The idea that performance can be so horrible that the system might as well have deadlocked is a severe problem. The ENOSPC issues from internal fragmentation is another severe problem. Then there is the lack of backports. I could continue, but I see no need.