`By: Clay Ferguson, May 14, 2023`
# Nostr Merkel+Modulo Balanced Query (MMBQ)
`Caveat: There will be a new version of this doc that uses MurmurHash instead Modulo for generating buckets, but that's a trivial alteration of the algo.`
The following is an explanation of two ways to deal with retrieval of Nostr Events from multiple relays, designed to get all information from all relays, and ensure all information is gotten, and to ensure no duplicate data is transferred from multiple relays.
In other words we want to avoid getting the same data from multiple relays, in cases where all relays are in sync relative to the results of a given query.
I'm not claiming to have invented the concept of using Merkle Trees for syncing, I'm just attempting to lay out the precise and simplest possible way I can see this technique of hashing a set of hashes (which I loosely equate to the term Merkle) being applied to Nostr Relays.
No one in the Nostr community is going to want to jump to a big merkle tree for all data, *but* applying the optimization I describe below seems like a great way to distribute load (load balance) across Relays *and* check for "in sync" or "not in sync" across relays too.
https://quanta.wiki/mobile/api/bin/6461649f07725530e5c83cc2?nodeId=646154a307725530e5c8394e