This is an automated email from the ASF dual-hosted git repository. rcordier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 11cc859752560bab52db76c2b3fb57531f40ce4b Author: Benoit Tellier <[email protected]> AuthorDate: Thu Oct 17 09:27:43 2019 +0700 JAMES-2919 ADRs for JMAP-draft GetMessages partial reads --- src/adr/0012-jmap-partial-reads.md | 40 +++++++++++++++++++++++++++ src/adr/0013-precompute-jmap-preview.md | 48 +++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) diff --git a/src/adr/0012-jmap-partial-reads.md b/src/adr/0012-jmap-partial-reads.md new file mode 100644 index 0000000..310cd2e --- /dev/null +++ b/src/adr/0012-jmap-partial-reads.md @@ -0,0 +1,40 @@ +# 12. Projections for JMAP Messages + +Date: 2019-10-09 + +## Status + +Proposed + +Adoption needs to be backed by some performance tests. + +## Context + +JMAP core RFC8620 requires that the server responds only properties requested by the client. + +James currently computes all of the properties regardless of their cost, and if it had been asked by the client. + +Clearly we can save some latencies and resources by avoiding reading/computing expensive properties that had not been explicitly requested by the client. + +## Decision + +Introduce two new datastructures representing JMAP messages: + - One with only metadata + - One with metadata + headers + +Given the properties requested by the client, the most appropriate message datastructure will be computed, on top of +existing message storage APIs that should remain unchanged. + +Some performance tests will be run in order to evaluate the improvements. + +## Consequences + +GetMessages with a limited set of requested properties will no longer result necessarily in full database message read. We +thus expect a significant improvement, for instance when only metadata are requested. + +In case of a less than 5% improvement, the code will not be added to the codebase and the proposal will get the status 'rejected'. + +## References + + - /get method: https://tools.ietf.org/html/rfc8620#section-5.1 + - [JIRA](https://issues.apache.org/jira/browse/JAMES-2919) diff --git a/src/adr/0013-precompute-jmap-preview.md b/src/adr/0013-precompute-jmap-preview.md new file mode 100644 index 0000000..e683ab2 --- /dev/null +++ b/src/adr/0013-precompute-jmap-preview.md @@ -0,0 +1,48 @@ +# 13. Precompute JMAP Email preview + +Date: 2019-10-09 + +## Status + +Proposed + +Adoption needs to be backed by some performance tests. + +## Context + +JMAP messages have a handy preview property displaying the firsts 256 characters of meaningful test of a message. + +This property is often displayed for message listing in JMAP clients, thus it is queried a lot. + +Currently, to get the preview, James retrieves the full message body, parse it using MIME parsers, removes HTML and keep meaningful text. + +## Decision + +We should pre-compute message preview. + +A MailboxListener will compute the preview and store it in a MessagePreviewStore. + +We should have a Cassandra and memory implementation. + +When the preview is precomputed then for these messages we can consider the "preview" property as a metadata. + +When the preview is not precomputed then we should compute the preview for these messages, and save the result for later. + +We should provide a webAdmin task allowing to rebuild the projection. The computing and storing in MessagePreviewStore +is idempotent and the task can be run in live without any concurrency problem. + +Some performance tests will be run in order to evaluate the improvements. + +## Consequences + +We expect a huge performance enhancement for JMAP clients relying on preview for listing mails. + +In case of a less than 5% improvement, the code will not be added to the codebase and the proposal will get the status 'rejected'. + +## References + + - https://jmap.io/server.html#1-emails JMAP client guice states that preview needs to be quick to retrieve + + - Similar decision had been taken at FastMail: https://fastmail.blog/2014/12/15/dec-15-putting-the-fast-in-fastmail-loading-your-mailbox-quickly/ + + - [JIRA](https://issues.apache.org/jira/browse/JAMES-2919) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
