摘要:
An apparatus, method, and machine-readable medium are described for managing data within a friend service. In one embodiment, a key/value data store can be used to provide an efficient and highly-scalable friend service database. Various techniques can be used to ensure data consistency between friend service data records. For example, in one embodiment, operations are detected which require updates to a plurality of related friend state records. A key may be generated to represent each of the operations and then used to create an entry in a write-ahead log database. In one embodiment, each entry in the write-ahead log database may specify the operation to be performed on the friend state records. If the plurality of friend state records are successfully updated, then the entry in the write-ahead log database may be deleted. However, if the plurality of friend state records are not successfully completed, then the entry is not deleted from the write-ahead log database. The friend state records associated with old entries in the write-ahead log database are checked for consistency and inconsistent records are repaired. In addition, optimistic locking techniques may be used in one embodiment to improve performance of the friend service database.