← 返回 snowflake 的题目列表Design a Key-Value Store
类型:online_judge
Design a key-value store that supports basic get and set operations. Extend it to support transactional operations with begin, commit, and rollback commands, each with constant time complexity. Further, extend the design to work efficiently in a multi-threaded environment.
Example
Input
set a 1
get a
begin
set a 2
get a
rollback
get a