kvcache

command module
v0.0.0-...-60e5113 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2015 License: MIT Imports: 29 Imported by: 0

README

kvcache

kvcache implements a simple key/value datastore for a particular use case:

  • Keys and values are just bytes
  • Keys are small (10-50 bytes) and values are large (kilobytes)
  • Keys and values only need to be accessed for a fixed time window

General implementation notes:

  • Key/value pairs have a fixed expiration duration
  • Key/value pairs are immutable, once written (until expired)
  • Key/value pairs are stored on disk in a rotating set of fixed-size append-only logs
  • The keys are associated with offsets into the log by an in-memory hashtable (can be reconstructed from an index written alongside each log)

Future optimizations

  • The DB mutex is a huge lock -> bottleneck
    • Shard the memCache, refCache to use more granular locks
    • Pull some ideas from the lock-free hash table literature
  • Now that RefMap is gone, I think we can get rid of the SHA-1 key hashing and just use keys everywhere.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
github.com/cespare/gostc
Package gostc implemenents a StatsD/gost client.
Package gostc implemenents a StatsD/gost client.
github.com/cespare/snappy
Package snappy implements the snappy block-based compression format.
Package snappy implements the snappy block-based compression format.
github.com/cespare/wait
Package wait provides Group, an extended version of sync.WaitGroup.
Package wait provides Group, an extended version of sync.WaitGroup.
github.com/dustin/go-humanize
Package humanize converts boring ugly numbers to human-friendly strings and back.
Package humanize converts boring ugly numbers to human-friendly strings and back.
github.com/edsrzf/mmap-go
Package mmap allows mapping files into memory.
Package mmap allows mapping files into memory.
github.com/garyburd/redigo/internal/redistest
Package redistest contains utilities for writing Redigo tests.
Package redistest contains utilities for writing Redigo tests.
github.com/garyburd/redigo/redis
Package redis is a client for the Redis database.
Package redis is a client for the Redis database.

Jump to

Keyboard shortcuts

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