Skip to content

About

Sqlite backend for hashicorp/raft

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

raft-sqlite

This is a sqlite backend for hashicorp/raft.

NOTE: this is slower than a proper key-value backend, in fact it's not recommended to use this in production if you are looking for performance. Stick to the default raft-boltdb or raft-mdb backends.

Usage

go get -u github.com/mauri870/raft-sqlite
//...
sqliteStore, err := raftsqlite.NewStore(filepath.Join(raftDir, "raft.db"))
//...
logStore := sqliteStore
stableStore := sqliteStore
_,_ := raft.NewRaft(config, (*fsm)(s), logStore, stableStore, snapshots, transport)

It is also possible to use the in-memory sqlite store:

sqliteStore, err := raftsqlite.NewStore("file::memory:?cache=shared")

NOTE: Never use just ":memory:", as it will create a new database for each connection instead of a shared database.

About

Sqlite backend for hashicorp/raft

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages