-
Notifications
You must be signed in to change notification settings - Fork 315
Description
We currently store both media and messages in the same SQLite database, which creates a couple of issues. The main problem is that we can’t remove downloaded media separately from cached messages—clearing the database affects both. While we could implement something that clears all tables, there’s also the challenge of having multiple concurrent writers. Since we record last accessed timestamps for the media cache, every media read results in a write, increasing the likelihood of write conflicts.
A cleaner solution would be to separate media and message storage into two distinct databases.
This would allow us to manage media caching independently from message storage, avoid unnecessary coupling, and reduce contention from concurrent database writes.