What purpose does the battery serve on a battery-backed caching RAID controller if the server is on an uninterruptible power supply?
Solution 1:
Your understanding is essentially correct.
Allowing the controller to cache write data in its local RAM improves write speed, however it exposes you to a risk of having the OS think data has been written to disk (because the controller has it) and having power fail before the controller completes that write. The battery back-up allows the data in the cache to survive until the machine is powered on again, mitigating that risk.
As far as benefit if your system is already on a UPS, what happens if you exceed your UPS runtime (possible even with a smart UPS), or if the server's power supplies blow up? Or if someone accidentally yanks the power cords out?
Many thing can cause a power failure. A UPS only protects against a few of them.
Solution 2:
There are two reasons for the battery;
- What if your PSU/s suddenly go pop - regardless of a UPS your system is dead and you may have had uncommitted data in your cache, having the battery ensures that the data is correctly written when power is restored. The same is true if you had a systemboard failure of course.
- What if something died on your actual disk controller, cables or disk enclosure/s? - say something snagged on the cable and damaged the connector at either end - again you may have data in your cache waiting to be written but no way to do it as the card, cable, enclosure etc is dead. You may have to replace the controller, if you have battery backed cache you could move that cache to a new card without losing the data.
These are both good reasons but to be honest flash-based caches have taken over from battery backed ones recently for obvious reasons and I'd recommend them first - that said if you do a lot of writing I'd recommend one or the other over just a UPS.