Oddbean new post about | logout
 I think a client has more things to store than just events that came from relays.  So it makes sense to store those in something that doesn't reflect a relay's storage system.  But when it comes to fetching events from local storage, I think having a similar interface to fetching events from a relay makes sense.  Pocket-db provides sucn an interface where you pass in a Filter (like you would in a REQ) and it returns the matching events.  At some point gossip's internal database changed its interface over to the same kind of thing.

But we also extract data out of events and store it into faster access structures. If we had to parse events every time we wanted to know who you follow, or what somebody's metadata says, etc, that would be too costly.  You can think of this local storage like a cache, but the interface looks like a custom set of tables.