1. A method comprising: creating, in a memory of a computer system, a first data structure having a plurality of contiguous buckets of the memory, the buckets configured to store key-value pairs in the order in which the key-value pairs are inserted into an array; creating, in the memory of the computer system, a second data structure having a plurality of slots of the memory, each of the slots corresponding to a particular key of the key-value pairs, each of the slots configured to store a pointer that points to a bucket of the first data structure containing a value of a key to which the slot corresponds, wherein the first data structure and the second data structure are different data structures, wherein the first data structure and the second data structure together form a combined data structure that represents the array, and wherein the combined data structure includes a first pointer to the first data structure and a second pointer to the second data structures; obtaining, upon insertion of a new key-value pair into the array, a new bucket from the first data structure, the new bucket being contiguous in the memory to a previously filled bucket, and a new slot from the second data structure, the new slot corresponding to a new key of the new key-value pair; storing, in the new bucket, the new key-value pair; and storing, in the new slot, a new pointer that points to the new bucket.