Relays are web sockets, a server and a client. Web sockets over #NOSTR should be cheap, because notes are broadcast, and when broadcasting notes, sockets are very efficient.
Let's say jack (npub1sg6…f63m) posts a note to a relay, that relay can BROADCAST that identical note to all it's clients who subscribe to Jack as opposed to sending differing data to all it's clients.
To estimate the potential savings, let's consider a scenario where a web socket server sends 1 KB of data to 100 clients.
Same data to all clients:
Memory: 1 KB (a single copy of the data)
CPU: 1-10% CPU usage (depending on the broadcasting implementation)
Network: 1 KB (a single packet sent to all clients)
Different data to each client:
Memory: 100 KB (100 separate copies of the data)
CPU: 10-100% CPU usage (depending on the packetization and sending implementation)
Network: 100 KB (100 separate packets sent to each client)
In this example, sending the same data to all clients can result in:
99% memory savings (1 KB vs. 100 KB)
90-99% CPU savings (1-10% vs. 10-100% CPU usage)
99% network savings (1 KB vs. 100 KB)
Keep in mind that these estimates are rough, but it makes the point that #NOSTR nodes should be very efficient, and thus relatively cheap in a competitive environment.
quotingOne common complaint we hear from Nostr haters is that there is no economic incentive to run relays or that the network will be centralized in a few central big relays. These claims often come from confusion or misunderstandings.
note1dqk…mahc
I think this 40s video will clear all the matters and answer all the criticisms:
If anyone doesn't understand or has a problem with this answer, please, I would like to hear it.