memstore

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

memstore

Distributed HA in memory store for Golang

Config Input

(all dflags so can be changed without restart)

  • List of DNS names, IPs (in Kubernetes you'd pass just a headless service name)
  • Refresh frequency for DNS to IP
Prototype
go run . -config-port 7999

Then go change the peers on http://localhost:7999/?type=dynamic to see:

20:26:10 I mstore.go:17> Peer set changed from  to a,b,c,z
20:26:10 I mstore.go:23> Connecting to added Peer        : "a"
20:26:10 I mstore.go:23> Connecting to added Peer        : "b"
20:26:10 I mstore.go:23> Connecting to added Peer        : "c"
20:26:10 I mstore.go:23> Connecting to added Peer        : "z"

and

20:26:31 I mstore.go:17> Peer set changed from a,b,c,z to d,a,b,z
20:26:31 I mstore.go:20> Disconnecting from removed peer : "c"
20:26:31 I mstore.go:23> Connecting to added Peer        : "d"

or similar

make test

Communication

Should we

  • use some broadcasting/bus
  • ring
  • tcp or http or grpc

Let's use a fully mesh broadcast using point2point h2.

Components

Discovery Service

Need to get list of (possible) peers

Pluggable module

Kubernetes

Endpoint(s) - or rather to make it simpler and allow by name addressing - StatefulSet (would also work better with istio than trying direct pod to pod by IP)

DNS

Embedded or separate

Why not both

Protocol

  • Zookeeper
  • Raft
  • Something wrong but simpler (*)

Persistence

  • Dump to disk (Persistent Volume in k8s) periodically

CircularBuffer

Both pub/sub thread safe blocking version and pure FIFO queue with set capacity versions:

See cb/cb.go

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
First In First Out (FIFO) [Queue] with fixed capacity.
First In First Out (FIFO) [Queue] with fixed capacity.
Set up a mesh network of broadcasting through point to point connections.
Set up a mesh network of broadcasting through point to point connections.
Implement kubernetes probes.
Implement kubernetes probes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL