hashicorp / go-memdb

Golang in-memory database built on immutable radix trees
https://pkg.go.dev/github.com/hashicorp/go-memdb
Mozilla Public License 2.0
3.19k stars 212 forks source link

Concurrent writing #80

Open liguangxue opened 4 years ago

liguangxue commented 4 years ago

Is it possible to increase the ability to write concurrently

lthibault commented 1 year ago

The issue with concurrent writes is that the caller needs to ensure his function is free of side-effects. That ends up being harder than one might first imagine, especially in a language like Go that doesn't provide first-class enforcement of functional purity. IMO, it it would be a mistake to change the semantics of go-memdb to support MPMC, if only because it would break backwards compatibility, but also because the single-writer principle can be applied to most systems.