17. A system for compressing a set of small strings, the system comprising: a processor; and a memory connected to the processor, the memory storing instructions to direct the processor to perform operations comprising: calculating n-gram frequencies for a plurality of n-grams over the set of small strings; selecting a subset of n-grams from the plurality of n-grams based on the calculated n-gram frequencies; defining a mapping table that maps each n-gram of the subset of n-grams to a unique code; determining an optimum length for the unique codes, the determining including: calculating a space saving amount over a subset of small strings from the set of small strings for each of at least two different unique code lengths, wherein the at least two different unique code lengths includes: (1) fixed single byte codes, (2) fixed 2-byte codes, and (3) variable-length one or two byte codes; and selecting as the optimum length the unique code length with the maximum space saving amount over the subset of small strings, wherein the unique codes are the optimum length; and compressing the set of small strings by replacing n-grams within each small string in the set of small strings with corresponding unique codes from the mapping table.
17. A system for compressing a set of small strings, the system comprising: a processor; and a memory connected to the processor, the memory storing instructions to direct the processor to perform operations comprising: calculating n-gram frequencies for a plurality of n-grams over the set of small strings; selecting a subset of n-grams from the plurality of n-grams based on the calculated n-gram frequencies; defining a mapping table that maps each n-gram of the subset of n-grams to a unique code; determining an optimum length for the unique codes, the determining including: calculating a space saving amount over a subset of small strings from the set of small strings for each of at least two different unique code lengths, wherein the at least two different unique code lengths includes: (1) fixed single byte codes, (2) fixed 2-byte codes, and (3) variable-length one or two byte codes; and selecting as the optimum length the unique code length with the maximum space saving amount over the subset of small strings, wherein the unique codes are the optimum length; and compressing the set of small strings by replacing n-grams within each small string in the set of small strings with corresponding unique codes from the mapping table. 18. The system according to claim 17 , wherein the subset of small strings from the set of small strings includes the whole set of small strings.