Optimizing Put Performance in Berkeley DB

前端 未结 2 682
醉话见心
醉话见心 2020-12-29 15:32

I just started playing with Berkeley DB a few days ago so I\'m trying to see if there\'s something I\'ve been missing when it comes to storing data as fast as possible.

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-29 16:28

    I suggest you must use transactions / TDS datastore if as you mention you cannot recreate a database (i.e. it isnt just a local cache) if it gets corrupted. If you dont care about loosing a few items in event of a crash/power outage then DB_TXN_WRITE_NOSYNC will improve TDS performance, you database will still be integral and recoverable. If you store using BTREE and a numeric index (if you have no natural key) and watch out for endian issues so you get good key locality and high page utilization then you should be able to get way more than 2000 inserts a second, especially to SSD, especially if you Use DbMultileKeyDataBuilder to do bulk inserts.

提交回复
热议问题