On Tue, 24 Mar 2015, at 07:39 AM, Matthew Wild wrote:
> The shard lookup daemon. This would be a problem with the current
> design. XMPP requires in-order processing and delivery of stanzas. If
> you have to delay a stanza based on a call to an out-of-process
> third-party, you're going to lose this unless you block the whole
> session until you receive the result. There isn't currently a way to
> do this in Prosody 0.9 (but there is in 0.10, with the async work).

Yeah, I was planning to build on the async work (which I still need to
read up on; first pass months ago made no sense to me, but hopefully I'm
smarter these days).

The nice thing is that I can cache pretty aggressively. A user will only
need to change servers when they're moved to another store (manual
process) or during failover. Both of these trigger a network broadcast
that tells everyone to invalidate their caches.

> Alternatively you could assign users to shards based on a hash or some
> other means that can be determined immediately without an external
> lookup. If you wanted to get fancy you could use "consistent hashing"
> to minimize disruption when adding/removing nodes to the cluster.

I did think about it, and I probably would if I was planning a separate
cluster of Prosody servers. Since I'm planning to run them on the mail
stores though it makes sense to keep all of a user in the same place
(and makes their storage access super-fast because its on the same host,
not that the internal network is slow).

> For the s2s nodes, make sure you set dialback_secret to some secret
> static string (the same on both nodes).

Yes. I knew that, but its a point that bears repeating :)

> There are some other things to consider if you haven't already. For
> example, off the top of my head... what shard will be responsible for
> offline users? Various things happen with offline users, including
> handling roster state changes (e.g. in response to subscription
> authorization) and the storage of offline messages. If every user has
> a fixed "home" shard, this is easy enough to handle.

Yep, fixed home shard.

Thanks for the feedback, I'm happy to know I'm not totally off track.
Now I just need to find time to finish it!

Cheers, Rob N.

-- 
You received this message because you are subscribed to the Google Groups 
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To post to this group, send email to prosody-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/prosody-dev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to