rosedb is an embedded k-v database based on LSM+WAL, so it has good write performance and high throughput. It also supports many kinds of data structures such as string
, list
, hash
, set
, zset
,and the API name style is similar to Redis.
rosedb is in pure Go
, simple and easy to understand for using or learning.
- Support rich data structure :
string
,list
,hash
,set
,zset
. - Support expiration and TTL.
- Has builtin rosedb-cli for command line.
- Easy to embedded (
import "github.com/roseduan/rosedb"
). - Low latency and high throughput.
Change the directory to rosedb/cmd/server.
Run the main.go
Open a new shell, and change the directory to rosedb/cmd/cli, and run the main.go
:
Import rosedb in the application:
import "github.com/roseduan/rosedb"
And open a database:
package main
import (
"github.com/roseduan/rosedb"
"log"
)
func main() {
config := rosedb.DefaultConfig()
db, err := rosedb.Open(config)
if err != nil {
log.Fatal(err)
}
// don`t forget to close!
defer db.Close()
//...
}
- Set
- SetNx
- Get
- GetSet
- Append
- StrLen
- StrExists
- StrRem
- PrefixScan
- RangeScan
- Expire
- Persist
- TTL
- LPush
- RPush
- LPop
- RPop
- LIndex
- LRem
- LInsert
- LSet
- LTrim
- LRange
- LLen
- HSet
- HSetNx
- HGet
- HGetAll
- HDel
- HExists
- HLen
- HKeys
- HValues
- SAdd
- SPop
- SIsMember
- SRandMember
- SRem
- SMove
- SCard
- SMembers
- SUnion
- SDiff
- ZAdd
- ZScore
- ZCard
- ZRank
- ZRevRank
- ZIncrBy
- ZRange
- ZRevRange
- ZRem
- ZGetByRank
- ZRevGetByRank
- ZScoreRange
- ZRevScoreRange
- Support expiration and TTL
- Support transaction, ACID features
- Compress the written data
- Add prefix scan and range scan for string type
- Add cache elimination strategy (LRU, LFU, Random)
- Cli for command line use.
- Improve related documents
rosedb is licensed under the term of the MIT License