What is a SequenceFile in Hadoop?

SequenceFile is a flat file with binary key–value pairs that are widely used in MapReduce I/O formats. Internally, the map outputs are saved as SequenceFile. It has courses for Reader, Writer, and Sorter.
The following are the three SequenceFile formats:

  1. Key–value records that aren’t compressed.
  2. Only the ‘values’ are compressed in these compressed key–value records.
  3. Both keys and values are gathered in ‘blocks’ independently and compressed in block compressed key–value records. The size of the ‘block’ can be changed.