#transaction #glue-sql #sled #shared #concurrency #active #sled-storage

gluesql_shared_sled_storage

GlueSQL shared sled storage, for concurrency and stability

10 releases

new 0.2.0 May 13, 2024
0.1.8 May 13, 2024
0.1.1 Mar 7, 2024

#727 in Database interfaces

Download history 285/week @ 2024-03-06 11/week @ 2024-03-13 13/week @ 2024-03-27 28/week @ 2024-04-03 772/week @ 2024-05-08

772 downloads per month

MIT license

16KB
361 lines

GlueSQL Shared Sled Storage

The stock SledStorage does not do concurrency. I added RwLock and transaction state on top of SledStorage to make it as easy to use as the stock SharedMemoryStorage.

  • RwLock: maintain each valid transaction, by preventing a new transaction while Sled is locked
  • TransactionState: prevent rollback, by avoiding/awaiting new transaction while another transaction that has begin but yet to commit
  • Drop: prevent rollback on next instance, by commiting transaction upon drop as graceful termination

Set await_active_transaction as true to await for the active transaction to commit. Set false to just return error when there is active transaction.

Dependencies

~18–31MB
~491K SLoC