Code Monkey home page Code Monkey logo

vegamcache's Introduction

vegamcache

vegamcache is a distributed in-memory cache built using gossip protocol for golang.

what is the difference between other distributed cache service?

In vegamcache, network calls are not used for retriving data for each Get. Instead data will be replicated across the node using gossip in backgroud.

Expired keys are removed on gossip instead of having a seperate GC.

seri why ?

Go is fun. I learned lot of thing regarding distributed system and also I'm jobless. Looking for internship. If anyone interested, do ping me at [email protected]

Drawback

  • Can be used only in golang
  • Consumes lot of main memory.(If you worring about memory, folks at google did a good job on group cache)

Need to be done

  • sharding the cache instead of storing it in a single hashmap
  • benchmarking against other cache service

Example

Clustered Cache

vg, err := vegamcache.NewVegam(&vegamcache.VegamConfig{Port: 8087,
            PeerName: "00:00:00:00:00:01",
            Peers: []string{"remoteip1:port","remoteip2:port"},
			Logger:   log.New(ioutil.Discard, "", 0)})
vg.Start()
defer vg.Stop()
if err != nil {
    panic(err)
}
vg.Put("foo", "bar", time.Second*200)
val, exist := vg.Get("foo")
if exist {
    fmt.Println(val)
}

Single Node Cache

vg := vegamcache.NewCache()
vg.Put("foo", "bar", time.Second*200)
val, exist := vg.Get("foo")
if exist {
    fmt.Println(val)
}

Contribution

Feel free to send PR. :)

vegamcache's People

Contributors

poonai avatar sgsullivan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vegamcache's Issues

add http server

for dynamic addition of peers.
It'll be used in creating kubernetes operator for vegamcache

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.