#4144·crawlee

Document storage backend decoration as the way to customize storages

Author: janbucharCreated Sep 18, 2026Updated Sep 18, 2026
Labelst-tooling
  • People try class CryptedKeyValueStore extends KeyValueStore (encryption, LRU caching). In v4 it constructs, but commitJournalEntries re-enters setValue, so an override runs twice inside a request handler, and values() / entries() bypass an overridden getValue. Frontend subclassing is not something we want to support.
  • The simplified StorageBackend / KeyValueStoreBackend contract makes a decorating backend the right answer: ~40 lines, works with transactions, rollback, useState, streams via withDirectStorageAccess, and getStorageBackendCacheKey() keeps it apart from the wrapped backend in the instance cache.
  • Write it up in the result storage guide with encryption and a read cache as the examples. Optionally ship a delegating base (DelegatingStorageBackend / DelegatingKeyValueStoreBackend) with pass-through defaults and a derived cache key, so a wrapper only overrides what it changes.