Libera-Chat / sable

GNU Affero General Public License v3.0
88 stars 8 forks source link

Make history backend modular #126

Closed progval closed 4 months ago

progval commented 6 months ago

The new sable_history crate defines a HistoryService trait, which could be implemented in various ways:

  1. in-memory, by querying the NetworkHistoryLog that every node has
  2. database-based, by querying a local or remote database (sqlite, postgresql, ...)
  3. remote, by querying an hypothetical dedicated node with a RPC mechanism that remains to be defined

For now, only item 1 is implemented, by moving the backend implementation of the CHATHISTORY command handler to sable_history.

The "hypothetical dedicated node" will probably be implemented by sable_history itself, and it will also benefit from the HistoryService, which will allow it to support multiple database backends, so we can more easily prototype and compare them.