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.

Reply to this note

Please Login to reply.

Discussion

It’s still VERY early stages. But that is one of the concepts of my #nostr relay. You can currently use in memory, file system, or SQLite. On my radar to add Postgres and remote relays, and hopefully more. https://github.com/rrainn/nostr-relay

Totally

The original Fietjeffs nostr relay does this with SQLite and postgress.

Maybe nostr protocol would be the right interface? Ofc it can be wrapped in get / set or publish / subscribe methods. https://github.com/nostr-protocol/nips/blob/master/01.md#communication-between-clients-and-relays