Skip to content

[STORY] Better leverage Redis Cache #2171

@chibenwa

Description

@chibenwa

Why ?

Cassandra is our most expensive storage (attached SSD)

We are currently using it in order to serve many small reads on small partitions, this translate into high usage of our core DB

Idea would be to use a Redis cache to offload small but frequent queries to our Cassandra DB

Identified tables

Keyspace Read Count: 230 592 580

Table: aclv2
Table: mailbox           Local read count: 19 111 982
Table: quotalimit        Local read count: 18 395 483
Table: mailboxpathv3     Local read count: 12 608 817
Table: modseq            Local read count: 17 375 742
Table: mailboxcounters   Local read count: 10 316 078
Table: rrt               Local read count: 10 222 739
Table: messagecounter    Local read count:  7 095 557
Table: quotacurrentvalue Local read count:  4 872 214
Table: domains           Local read count: 9 096 454
Total: ~109M smallish requests

Design

TTL 1 day

Read path

GET key from Redis
  if hit → return
  if miss → read Cassandra → SET Redis → return

Write path

update Cassandra
SET Redis (same key)

Must be fully failure prone

Process

  • Validate the gains with a key table like mailbox
  • Then leverage interface to add redis caching where relevant...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions