A method performed at a data storage device that includes a controller and a memory, the method comprises: receiving from a host device a first write command corresponding to first data, the first write command including a first context identifier which identifies a first context associated with the first data, wherein the first context identifier is assigned by the host device to indicate a first operational context associated with the first data within the host device; receiving from the host device a second write command corresponding to second data, the second write command including a second context identifier which identifies a second context associated with the second data, wherein the second context identifier is assigned by the host device to indicate a second operational context associated with the second data within the host device; characterised in that the method further comprises: writing the first data to the memory prior to responding to the second write command; determining whether the first context identifier of the first context matches the second context identifier of the second context; and after responding to the second write command, if the first context identifier of the first context is determined to match the second context identifier of the second context: reading the first data from the memory; combining the first data and the second data to form a compression group of data including the first data and the second data; generating compressed data corresponding to the compression group of data; and writing the compressed data to the memory; the method further comprising determining a size of the compression group of data, wherein the compressed data is generated responsive to determining that the size of the compression group of data exceeds a threshold size. receiving from a host device a first write command corresponding to first data, the first write command including a first context identifier which identifies a first context associated with the first data, wherein the first context identifier is assigned by the host device to indicate a first operational context associated with the first data within the host device; receiving from the host device a second write command corresponding to second data, the second write command including a second context identifier which identifies a second context associated with the second data, wherein the second context identifier is assigned by the host device to indicate a second operational context associated with the second data within the host device; writing the first data to the memory prior to responding to the second write command; determining whether the first context identifier of the first context matches the second context identifier of the second context; and after responding to the second write command, if the first context identifier of the first context is determined to match the second context identifier of the second context: reading the first data from the memory; combining the first data and the second data to form a compression group of data including the first data and the second data; generating compressed data corresponding to the compression group of data; and writing the compressed data to the memory; the method further comprising determining a size of the compression group of data, wherein the compressed data is generated responsive to determining that the size of the compression group of data exceeds a threshold size. reading the first data from the memory; combining the first data and the second data to form a compression group of data including the first data and the second data; generating compressed data corresponding to the compression group of data; and writing the compressed data to the memory; the method further comprising determining a size of the compression group of data, wherein the compressed data is generated responsive to determining that the size of the compression group of data exceeds a threshold size.