# Gache notions ## Basic idea Like Memcached, plus... * Usability: * True FLUSHALL * Single process for multiple bins * Management * Complete locking dump/restore * Snapshots * Tag support * Pluggable storage * Journaling * Write-back/write-through replication * Chained storage (fast → slow) But probably slower overall, just more convenient. ## Components * Protocol handling (FSMs) * Application: Memcache protocol proper * Presentation: ASCII / Binary * Transport: * TCP with persistent connections * TCP without persistent connections * UDP * raw socketpair (stdin/stdout) * Readline equivalence for ASCII presentation interactions * Storage * Pluggable storage * Journaling * Storage engines * Memory * Memcached, for use as a debugging proxy in front of a standard instance * Others ? * Memory * Main memory allocation * Slab allocator * Reporting * Background expiration lurker ## Memory allocation ### Memcache slabs model * http://www.mikeperham.com/2009/06/22/slabs-pages-chunks-and-memcached/ (2009) * Older versions of memcached used slabs sized based on powers of two, so you'd have a 1KB slab, 2KB slab, 4KB slab, ..., all the way to 1MB. * Newer (2006: 1.2.0-RC1 ?) versions use 1.25^n for the chunk size * Allocate slabs for elements of a given size range ("chunks") * Slabs are made of fixed-size (1MB) pages, split according to the chunk size * Slab chunk sizes are in a geometric progression: (1 + x)^n