Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
luckyycode opened this issue Jul 15, 2022 · 3 comments
Labels
feature-request New feature or request

Comments

@luckyycode
Copy link

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

@Aquathing
Copy link
Collaborator

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 ([Request] Implement ability to upload and download files #1) and messages (Messages local cache #4).

@Aquathing Aquathing added the need-more-info Further information is requested label Jul 15, 2022
@luckyycode
Copy link
Author

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

@Aquathing
Copy link
Collaborator

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 Aquathing added feature-request New feature or request and removed need-more-info Further information is requested labels Jul 15, 2022
@Aquathing Aquathing changed the title Session serializer and session storage Merge the two storages and give the users the ability to write their own database drivers Jul 15, 2022
@Aquathing Aquathing changed the title Merge the two storages and give the users the ability to write their own database drivers Merge the two storages and give users the ability to write their own database drivers Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants