1. A method for compressing objects, comprising: receiving a request to write a first object including a first key and a first value, wherein the first object is of a given type; receiving a request to write a second object including a second key and a second value, wherein the second object is of the given type; classifying the first object to a compression dictionary according to at least one rule based on a value of the first object and/or the key of the first object; classifying the second object to the compression dictionary according to at least one rule based on a value of the second object and/or the key of the second object; and compressing the first object and the second object based on the compression dictionary; identifying first matching patterns in a pair of objects; determining if the number of first matching patterns exceeds a first threshold; when the number of first matching patterns is determined to exceed the first threshold, selecting an object from the pair of objects and identifying second matching patterns in the selected object and the compression dictionary; determining if the number of second matching patterns exceeds a second threshold; and when the number of second matching patterns is determined to exceed the second threshold, assigning the pair of objects to the compression dictionary.