element-hq / element-hq/synapse

Using an external cache server

Open
#2,123 0 comments 0 reactions 0 assignees View on GitHub
T-Task
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#2123](https://github.com/matrix-org/synapse/issues/2123).

---

I found that synapse uses a cache, implemented its own means (synapse/util/caches).
This creates some difficulties:

- with scaling ([workers must communicate with master process](https://github.com/matrix-org/synapse/blob/master/docs/workers.rst) in order to have the same data in the cache and with the database)
- with clustering for high availability (I've read @ara4n in [#matrix:matrix.org](https://matrix.to/#/#matrix:matrix.org) that the synapse does not provide the clustering capability).

I believe that using an external cache server like [memcached](https://memcached.org/) or [reddis](https://redis.io/) could solve these problems.

The advantages of an external cache:

- it can be accessed by all the processes of application, possibly running on several nodes.
- memory storage is quite efficient, and done in a separate process.
- it becomes possible to configure workers to use same cache and same database as synapse.
- it becomes possible to configure two synapse servers are behind the balancer and work with one cache and a shared database.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.