dpc on Nostr: BTW. The websocket thing is something I wonder about often. In a use-case with ...
BTW. The websocket thing is something I wonder about often. In a use-case with reasonably frequent updates, is it better to have clients hold an active but mostly idle tcp connection (like websocket), or make them do polling, or some long polling?
A proper async IO runtime can probably handle tons of connections at once anyway. 10k, 100k, maybe 1M.
Also with a gossip-like note fetching, it should be feasible to have lots moderately sized relays, without a loss to usability, so maybe worrying too much about scaling vertically a single relay is unnecessary.
Otherwise some client&application level load balancing might fix the problem. Eg when connecting to a relay it answers with a list of keyspace "shards" (possibly overlapping for redundancy), and then connects/queries to the actually node that holds the data. That would allow reasonably simple and flexible scaling of the relays without complex server side load balancing.
Published at
2023-04-15 20:44:27Event JSON
{
"id": "f4d62d6e15bf41f9783f669290503c3dd6beb8a7b39d69010f8fd92b1d7396b0",
"pubkey": "274611b4728b0c40be1cf180d8f3427d7d3eebc55645d869a002e8b657f8cd61",
"created_at": 1681591467,
"kind": 1,
"tags": [
[
"e",
"53eb5d1ce61a35e5cf0afd99475dc3613047914380d1afa1a781e1982823a7a7",
"",
"root"
],
[
"e",
"6e9d74396e257ccf6e5613702863561866f818939830e56c007e37478f777086",
"",
"reply"
],
[
"p",
"8eee8f5a002e533e9f9ffef14c713da449c23f56f4415e7995552075a02d1d37"
],
[
"p",
"274611b4728b0c40be1cf180d8f3427d7d3eebc55645d869a002e8b657f8cd61"
]
],
"content": "BTW. The websocket thing is something I wonder about often. In a use-case with reasonably frequent updates, is it better to have clients hold an active but mostly idle tcp connection (like websocket), or make them do polling, or some long polling?\n\nA proper async IO runtime can probably handle tons of connections at once anyway. 10k, 100k, maybe 1M.\n\nAlso with a gossip-like note fetching, it should be feasible to have lots moderately sized relays, without a loss to usability, so maybe worrying too much about scaling vertically a single relay is unnecessary.\n\nOtherwise some client\u0026application level load balancing might fix the problem. Eg when connecting to a relay it answers with a list of keyspace \"shards\" (possibly overlapping for redundancy), and then connects/queries to the actually node that holds the data. That would allow reasonably simple and flexible scaling of the relays without complex server side load balancing.",
"sig": "8e4e17c1416515a86920e93c768a96f8191ede82de408f1e3272462af7d8e9f5f7d786ea5a7e5bf9637d80df93cf79210e43ccfb5f49d3a310289d79ea4ceb73"
}