Files
workavia-mail-front/docs/adr/0027-use-tuplekey-store-data-cache.md
dab246 3799f39a15 TF-1861 Add adr to use work manager
(cherry picked from commit 0a1c659327d74bc0b9c50fe2b2b1e7d3f3fcd1ae)
2023-06-05 11:02:20 +07:00

611 B

27. Use TupleKey store data cache

Date: 2023-04-27

Status

Accepted

Context

  • Multiple accounts login at the same time in the same browser. The accounts will use the same database (IndexDatabase).

Decision

  • Use unique parameters (AccountId, UserName, ObjectId(MailboxId/EmailId/StateType) to form a unique key for storage (called TupleKey).
  • TupleKey has the format: ObjectId | AccountId | User;
  • HiveDatabase includes many Box. Each box is a Map<Key, Object> with key=TupleKey.

Consequences

  • The correct mailbox and email lists are obtained for each account