"Relays should not be treated as databases" is silly and can kill nostr.

The relay query language was designed around a social notes client use-case. The "other stuff" that we love to talk about, as much as it's part of the nostr acronym, is an afterthought.

Other stuff clients do not work like social clients. They have way more specific requirements and hence need to use relays more like databases.

Since the query language is terribly limiting, this results in:

- Higher amount of requests

- More bandwidth

- More client-side processing

Do we want nostr to compete in terms of UX with other platforms/protocols or be forever lagging behind?

Worst of all, this leads developers to implementing hacks to perform queries (custom languages via NIP-50, for instance) which entirely defeats the point of a relay: to be easily swappable.

If we can't easily swap relays, nostr is dead.

The rationale for not treating relays as databases is based on the fallacy of simplicity. Since we want anyone (yes including your grandma) to create a relay we must make it as simple as possible – so we should not force implementation details such as requiring a database.

But guess what is the simplest way to build a relay? Using a database.

If we want nostr to succeed we must grow up, assume that relays will have a database backend, and reach consensus on a better query language that we're confident can be implemented in most engines (SQL, noSQL, graph, and so on).

Not perfection, not a highly complex language, but something that allows more flexibility than the archaic filters we have right now.

Reply to this note

Please Login to reply.

Discussion

Not being able to execute more complex queries on relays tips the balance in favor of custom API servers.

Any service that values great UX (and no, we have awful UX on nostr so far) will end up choosing a custom server. This means users will lack the ability to manage servers like they do with relays, and therefore reduce user choice and decentralization.

Few.

nostr:nevent1qvzqqqqqqypzqun2rcnpe3j8ge6ws2z789gm8wcnn056wu734n6fmjrgmwrp58q3qy2hwumn8ghj7un9d3shjtnyv9kh2uewd9hj7qgawaehxw309ahx7um5wghx6at5d9h8jampd3kx2apwvdhk6tcqyrfamps30qqu0c7kmkvj43ngkmkzqvm777l7qfm8e3dms8pxy77qu9sqsnk

You mention that nostr “works” for social clients but not yet there for “other stuff”. Just keep in mind, its at the very least debatable if it works for social:

1. No likes

2. No followers

3. Broken profiles

4. No search

5. No private messages (yet)

6. No groups (yet)

7. No stats

8. No attachments

9. Single account for life

10. … list goes on

And the answer is usually “you don’t need it and hoy you will be happy”

The thought to change query language in future is interesting.

P.S. regarding “to database or not” I personally don’t have strong opinion but rather tend to believe “relays for transmitting, layer-2 for clients”

I'm going to call it "slightly improving the filters" and maybe I'll get better reactions! Everybody uses relays as databases and they insist they don't.

Three approaches to solve (more) complex querying:

- Denormalization, nostr:npub1xdtducdnjerex88gkg2qk2atsdlqsyxqaag4h05jmcpyspqt30wscmntxy 's favorite 😄. It does help and the route I'm opting to take, but just by pure chance as I'm still able to somewhat control the shape of kind 32267. For kinds out in the wild, this is impractical or impossible

- Proprietary backend that talks to the relay database. Throw the nostr towel, embrace speed/UX at the expense of backend replaceability/decentralization. Running it as DVM could be a marginal improvement if spec'd

- REQ filters improvement. Done well it could cover many more querying cases, improve speed/UX with little impact on relay operators. The conversation I'm trying to open but it ruffled some feathers

nostr:nevent1qvzqqqqqqypzqun2rcnpe3j8ge6ws2z789gm8wcnn056wu734n6fmjrgmwrp58q3qy2hwumn8ghj7un9d3shjtnyv9kh2uewd9hj7qgawaehxw309ahx7um5wghx6at5d9h8jampd3kx2apwvdhk6tcqyrfamps30qqu0c7kmkvj43ngkmkzqvm777l7qfm8e3dms8pxy77qu9sqsnk