Nostr relays, caches, and databases should all use the same storage interface so you can compose and replace them. You should be able to use a remote relay, SQLite, or in-memory cache interchangeably with the exact same interface.