A method of writing data units to a storage device. The data units are cached in a first level cache sorted by logical address. A group (Gj) of sorted data units is transferred from the first level cache to a second level cache embodied in a solid state memory device. Data units of multiple groups (Gj) are sorted in the second level cache by logical address. The sorted data units stemming from the multiple groups are written to the storage device.