Client icon indicating copy to clipboard operation
Client copied to clipboard

Merge the two storages and give users the ability to write their own database drivers

Open luckyycode opened this issue 3 years ago • 3 comments

CatraProto currently supports the only one session serializer of type FileSerializer Application is hosted in Kubernetes container and it's not comfortable to use FileSerializer because it requires app to have a local path to store session data

My request is to document IAsyncSessionSerializer interface and let end-user to choose what type of storage one would like to use. Currently it's sqlite, but maybe CatraProto should have a separate interface for session storage to abstract away from sqlite and use custom storage together with custom IAsyncSessionSerializer implementations

luckyycode avatar Jul 15 '22 13:07 luckyycode

CatraProto currently supports the only one session serializer of type FileSerializer

CatraProto supports any serializer implementing IAsyncSessionSerializer

My request is to document IAsyncSessionSerializer interface and let end-user to choose what type of storage one would like to use.

IAsyncSessionSerializer is documented here

Currently it's sqlite

IAsyncSessionSerializer and the SQLite database are two separate things:

  • IAsyncSessionSerializer stores vital information about the session (auth_keys, authorization_state, for example) and some less vital, but rarely written stuff such as common updates state and channel updates state

  • The SQLite database instead mainly stores a cache of peers and in the near future also information about files (#1) and messages (#4).

Aquathing avatar Jul 15 '22 14:07 Aquathing

I get it, that IAsyncSessionSerializer and sqlite provider are separate things, what I am talking about is to give ability to use something else but sqlite

luckyycode avatar Jul 15 '22 14:07 luckyycode

Good. Then I would say it's best to just merge the two databases and give the user the ability to write their own driver (while also shipping a default SQLite driver)

Aquathing avatar Jul 15 '22 14:07 Aquathing