Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Config store performance improvement
Summary: This is to improve the performance of config store. This improvement is compatible with the old version. Previously, when writing to the database, we save the database to local disk. The improvement is to only append the changes to the disk when the writing/overriding/deleting is needed. The following procedure shows the steps of this improvement in detail: 1. Write/Override to database. 2. Append PersistentObject: ('add', key, value) to the disk. This step requires the serialization of the PersistentObject to iobuf. Another example is to delete a key from databse, and the PersistentObject is: ('del', key, optional value). 3. An example of the file on the disk is: ``` ('add', key1, value1) ('add', key2, value2) ('del', key1, value1) .... ``` Periodically, we need to make the file on the disk to be compact. In the above example, after reorganization, we have ``` ('add', key2, value2) ... ``` This step requires loading the file from the disk and merging the changes to the same key, which is a deserialization procedure. The file loaded is put into the iobuf, and deserialized to many PersistentObjects, and then put into database. ``` iobuf -> PersistentObjects -> databse Reviewed By: saifhhasan Differential Revision: D15806558 fbshipit-source-id: b82018603ff3bef01c972d5a3b56e4bd3a3b83f9
- Loading branch information
1 parent
9c53cbd
commit 8e04a93
Showing
3 changed files
with
473 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.