Nested object serialization and deserialization
AssigneeAmazon Technologies, Inc.
InventorsWei Xiao, Usman Ahmed Shami, Fahad Ahmed, Andrew Desmond Budiman
Life of this patent
Estimating the term…
Abstract
A database may store an object comprising a hierarchy of sub-objects. Numeric identifiers may be assigned to names of the sub-objects and used in place of the names when writing the object to storage. Scalar values may be prefixed with length indicators. Collections may be prefixed with counts indicative of the number of elements in the corresponding collection. A portion of the object may be retrieved from storage by traversing a path from the root of the hierarchy to the desired portion. Length and count information may be used to skip over portions of the object during the traversal.
Claims20
A system for storing hierarchical objects, the system comprising:
- a storage device;
- and
- a computing node in communication with the storage device, wherein the computing node at least:
- receives a request to store an object, the object comprising a hierarchy of sub-objects including a first sub-object associated with a first name, and a second sub-object associated with a second name, the first sub-object comprising a first scalar value and the second sub-object comprising a list of a plurality of additional sub-objects;
- forms a map comprising a first numeric identifier formed to represent the first name of the first sub-object and a second numeric identifier formed to represent the second name of the second sub-object;
- stores a representation of the object on the storage device, the representation comprising the map, a second instance of the first numeric identifier in place of the first name, a first field indicative of a size of the first scalar value followed on the storage device by the first scalar value, and a second field indicative of a number of entries in the list followed on the storage device by representations of the plurality of additional sub-objects;
- retrieves the second sub-object from the storage device, by at least locating the second sub-object in the storage device based at least in part on the first field indicative of the size of the first scalar value of the first sub-object;
- and
- retrieves a third sub-object stored subsequent to the second sub-object on the storage device, by at least locating an end of the second sub-object on the storage device based at least in part on the second field indicative of the number of entries in the list.
A method for storing hierarchical objects on a storage device, the method comprising:
- receiving information indicative of storing, on the storage device, an object comprising a hierarchy of sub-objects including a first sub-object and a second sub-object, the first sub-object comprising a first scalar value and the second sub-object, the second sub-object comprising a collection of additional sub-objects;
- storing a map comprising a first numeric identifier indicative of a first name of the first sub-object of the hierarchy of sub-objects and a second numeric identifier indicative of a second name of the second sub-object of the hierarchy of sub-objects;
- storing, on the storage device, a second instance of the first numeric identifier in place of the first name, a first field indicative of a size of the first scalar value followed by the first scalar value, and a second field indicative of a number of entries in the collection followed by representations of the additional sub-objects;
- locating the second sub-object on the storage device, based at least in part on the first field indicative of the size of the first scalar value;
- and
- accessing a third sub-object stored subsequent to the second sub-object on the storage device by at least locating an end of the second sub-object, the locating based at least in part on the second field indicative of the number of entries in the collection.
A non-transitory computer-readable storage medium having stored thereon instructions that, upon execution by a computing device, causes the computing device at least to:
- receive information indicative of storing, on a storage device, an object comprising a hierarchy of sub-objects including a first sub-object and a second sub-object, the first sub-object comprising a first scalar value and the second sub-object, the second sub-object comprising a collection of additional sub-objects;
- store a map comprising a first numeric identifier indicative of a first name of the first sub-object of the hierarchy of sub-objects and a second numeric identifier indicative of a second name of the second sub-object of the hierarchy of sub-objects;
- store, on the storage device, a second instance of the first numeric identifier in place of the first name, a first field indicative of a size of the first scalar value followed by the first scalar value, and a second field indicative of a number of entries in the collection followed by representations of the additional sub-objects;
- locate the second sub-object on the storage device, based at least in part on the first field indicative of the size of the first scalar value;
- and
- access a third sub-object stored subsequent to the second sub-object on the storage device by at least locating an end of the second sub-object, the locating based at least in part on the second field indicative of the number of entries in the collection.
Dependencies are inferred from the claim text.