[#472] blobstor: implement write-cache

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-04-06 13:56:06 +03:00 committed by Alex Vanin
parent 96a8ee7c83
commit 59de521fd1
24 changed files with 1011 additions and 116 deletions

View file

@ -0,0 +1,20 @@
// Package writecache implements write-cache for objects.
//
// It contains in-memory cache of fixed size and underlying database
// (usually on SSD) for storing small objects.
// There are 3 places where object can be:
// 1. In-memory cache.
// 2. On-disk cache DB.
// 3. Main storage (blobstor).
//
// There are 2 types of background jobs:
// 1. Persisting objects from in-memory cache to database.
// 2. Flushing objects from database to blobstor.
// On flushing object address is put in in-memory LRU cache.
// The actual deletion from the DB is done when object
// is evicted from this cache.
//
// Putting objects to the main storage is done by multiple workers.
// Some of them prioritize flushing items, others prioritize putting new objects.
// The current ration is 50/50. This helps to make some progress even under load.
package writecache