djherbis
About Tags Contact

Mar 28, 2015

Written by djherbis

#golang stream caching

djherbis/fscache Objective Our Web server needs to perform an “expensive” process to create downloads. We want to cache these files so they don’t have to be generated on every request. If two or more concurrent clients ask for the same file, don’t generate it twice. A naive cache design might look like this: Well the above code is pretty bad. We’re blocking all requests while the cache is being written to.

Tags:  golang ,  stream ,  cache

Mar 10, 2015

Written by djherbis

#golang persistence with boltdb and djherbis/stow

djherbis/stow I like the simplicity behind boltdb however constantly converting your structs to and from an []byte can introduce a lot of extra code. So I created stow. Stow wraps a bucket in your boltdb database so that it works a little bit more like a map. Stow can use any encoding for storing your data, which will be transparently encoded/decoded when you Put, Get or Pull from your Store.

Tags:  golang ,  persistence ,  boltdb

Copyright © 2017
Powered by Hugo & Pixyll