Home > Storage > ObjectScale and ECS > Product Documentation > Dell ECS: High Availability Design > XOR encoding
To maximize storage efficiency of data that is configured with a replication group containing three or more sites, ECS uses XOR encoding. As the number of sites in a replication group increases, the ECS algorithm is more efficient in reducing the overhead.
XOR encoding is performed at each site. It scans its chunk manager table, and when it finds COPY type chunks that are from each of the other sites in its replication group, it can perform XOR encoding on these chunks.
For example, the table that follows shows site 3 of a three-site configuration that has both chunks C2 and C3 that are COPY type, each with a different primary site. This configuration allows site 3 to XOR them together and store the result. The result is a new chunk, C5, which is an XOR of C2 and C3 (mathematically, C2 ⊕ C3). It has a type of Parity, without a secondary site. The chunk IDs of parity chunks are not broadcast to other sites.
Primary site | Secondary site | Type | |
C1 | Site 1 | Site 2 | Remote |
C2 | Site 2 | Site 3 | Copy |
C3 | Site 1 | Site 3 | Copy |
C4 | Site 2 | Site 1 | Remote |
C5 | Site 3 |
| Parity (C2 and C3) |
After XOR is complete, the data copies for C2 and C3 are deleted. This action frees up space on disk, and the chunk manager table type for these chunks changes to Encoded. The XOR operation is purely a secondary-site operation, and the primary site is not aware that its chunks were encoded. The following table shows the site 3 chunk manager after XOR encoding is complete and the data copy for C2 and C3 is deleted.
Chunk ID | Primary site | Secondary site | Type |
C1 | Site 1 | Site 2 | Remote |
C2 | Site 2 | Site 3 | Encoded |
C3 | Site 1 | Site 3 | Encoded |
C4 | Site 2 | Site 1 | Remote |
C5 | Site 3 |
| Parity (C2 and C3) |
Requests for data in an encoded chunk are serviced by the site containing the primary copy. For more details about storage efficiency, see the ECS Overview and Architecture White Paper.