Upon my load testing campaign, I noticed `SELECT * FROM domains WHERE domain=xxx;` to be one of our "hot" query, both on JMAP load when JWT is used (because there is a lookup to the domain before granting access), but also backend processing.
This query load have a real impact (low but real) on the load we are able to handle.
On my use case (on premise in customer site) the domains (almost) never change, and, say, 10s propagation upon creation are acceptable.
Thus I would like to propose an opt-in cache mechanism to reduce the query load on Cassandra (but other implementation as well!). A cache on each node is ok, as the volume of domain is expected-to-be very low.
Of course, it should be explicitly configured, and disabled by default. Of course we should warn this is experimental.
Expected outcome is a 99% decrease of that query volume.