Skip to content

Allow sqlite db to be saved in a different location #49

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

Closed
ellisonbg opened this issue Nov 9, 2022 · 4 comments
Closed

Allow sqlite db to be saved in a different location #49

ellisonbg opened this issue Nov 9, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@ellisonbg
Copy link

Problem

We are testing this on an NFS filesystem and finding that the sqlite ystore that is default is struggling to keep up on this filesystem. To resolve this, we are experimenting with putting the sqlite db on a different (and faster) filesystem. We have made changes in our local source to change the location and it seems to resolve the performance issues, but we would like the db location to be configurable.

Proposed Solution

Add a new configurable trait to set the location of the sqlite db.

@ellisonbg ellisonbg added the enhancement New feature or request label Nov 9, 2022
@ellisonbg
Copy link
Author

I should note, when we moved the sqlite db, we began to see this exception raised in the logs:

https://github.com/jupyter-server/jupyter_server_ydoc/blob/v0.1.14/jupyter_server_ydoc/ydoc.py#L124

@davidbrochart
Copy link
Collaborator

This is strange, the exception you're mentioning is related to the file ID SQLite database, not the YStore SQLite database.

@davidbrochart
Copy link
Collaborator

Add a new configurable trait to set the location of the sqlite db.

There is already a collaborative_ystore_class trait in JupyterLab, that allows to even use another backend for storing Y updates (can be a file, a temporary file, or an SQLite database for now).
To change the location of the SQLite database, you need to subclass SQLiteYStore and override db_path:

from ypy_websocket.ystore import SQLiteYStore

class MySQLiteYStore(SQLiteYStore):
    db_path = "path/to/my/ystore.db"

Then pass this class e.g. at the command line:

jupyter lab --collaborative --LabApp.collaborative_ystore_class=my_module.MySQLiteYStore

@davidbrochart
Copy link
Collaborator

The way to pass the YStore class at the CLI is now:

jupyter lab --collaborative --YDocExtension.ystore_class=my_module.MySQLiteYStore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants