Patent ID: 8554997

Claim:
A non-transitory computer readable medium comprising instructions, which when executed by a processor perform a method, the method for storing data comprising: receiving a request to write data; determining a storage mode for the data, wherein the storage mode for the data is mirrored mode; selecting a Redundant Array of Independent Devices (RAID) grid location in a RAID grid to write the data based on the storage mode; writing the data to memory, wherein the data is temporarily stored in the memory; updating a data structure to indicate that the RAID grid location is filled; determining, using the data structure, whether a data grid in the RAID grid is filled, wherein the RAID grid location is in the data grid; based on a determination that the data grid is filled: calculating parity values for the RAID grid using the data; determining a first physical address in persistent storage corresponding to the RAID grid location; determining a second physical address in the persistent storage corresponding to the RAID grid location; writing the data to a first physical location in the persistent storage corresponding to the first physical address; writing the data to a second physical location in the persistent storage corresponding to the second physical address; and writing the parity values associated with data grid to the persistent storage.