al8n / skipdb

An embedded, in-memory, zero-copy, atomicity, consistency, isolation, MVCC, almost lock-free and serializable snapshot isolation database engine.
Apache License 2.0
204 stars 4 forks source link

Feature request: evict items when limits are reached. #16

Open beckend opened 4 months ago

beckend commented 4 months ago

To not crash the app by eating all memory. Optional ability to limit by total size or number of keys. Probably LRU eviction, even allow user to provide callback.

al8n commented 4 months ago

Optional ability to limit by total size or number of keys

Yeah, this a reasonable feature.

Probably LRU eviction, even allow user to provide callback.

There is a compact method to allow users to remove old version entries. The crate is not a cache but an in-memory MVCC database.