1 which is better for webserver
2 for db?
3 at what amount of ram or disk does one prefer over other?
4 why?
1) I don't know. It probably makes very little difference.
2) I don't know. It also probably makes very little difference.
3) In my experience ZFS needs a minimum of somewhere between 2GB and 4GB of RAM on the system. However, my experience is very limited.
4) for 1 and 2, I don't know because I haven't done any extensive testing. I've run Web servers on both UFS and ZFS and have not seen much of a difference. I have run database (PostgreSQL and MySQL) on UFS without any issues. For #3 there is documentation that suggests in "low ram environments" you need to tweak some ZFS settings and the system I run ZFS on has 16GB of ram but ZFS has never used more than 4GB (and usually is using less).
Benefits of ZFS:
- Very easy software RAID setup (useful if you have multiple hard drives).
- snapshots are very handy for a variety of system administration tasks.
- other functionality that makes system administration much easier.
- you can use an SSD as a cache for large arrays of spinning disks to (theoretically) speed things up.
- you can create multiple data sets in a raid pool (roughly like making multiple FreeBSD partitions in a slice) that all share the same space among them while still being able to set upper limits on how much a single data set can consume. Think about creating and destroying a bunch of jails over time (like you might in a shared hosting setup).
- some cross-platform compatibility (Solaris, some Linux, and other OSes support ZFS too).
Benefits of UFS:
- Uses significantly less system resources (RAM and CPU) compared to ZFS.
- Backwards compatible with earlier versions of FreeBSD.
The both offer:
- software RAID (UFS and GEOM together, handbook chapter 18)
- ability to compress partitions/pools (see geom_uzip)
- ability to encrypt partitions/pools (UFS and GEOM together, handbook chapter 18)
- fault tolerance (UFS with softupdates or journaling)
If you have not used ZFS before, I suggest you try it out. In my opinion, the simplified administrative functionality alone is worth it if you have the RAM to handle it.