摘要 |
Disclosed are a method and device for storing data. The method comprises: determining the same column attribute of at least two data objects to be stored in a Key Value type distributed database; determining a row identifier format of each data object of the at least two data objects in the Key Value type distributed database, the row identifier format comprising the same column attribute and a data object identifier, data object identifiers of different data objects being in the same position in the row identifier format and being located behind the same column attribute; according to the row identifier format of each data object, determining a row identifier value of each data record of each data object; and storing the row identifier value of each data record and each data record in the Key Value type distributed database, the row identifier value of each data record being used as a primary index of each data record in the Key Value type distributed database. The method and device for storing data in the embodiments of the present invention can improve the efficiency of querying data. |