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

Keep Demos on Disk ? #33

Open
jayceslesar opened this issue Apr 7, 2024 · 3 comments
Open

Keep Demos on Disk ? #33

jayceslesar opened this issue Apr 7, 2024 · 3 comments

Comments

@jayceslesar
Copy link
Contributor

Might not be the wisest idea to keep demos in the DB, but we can back them out with the following query at least:

\copy (
     SELECT loid, STRING_AGG(data, '' ORDER BY pageno) AS all_data
     FROM pg_largeobject
     JOIN demo_sessions demo ON demo.demo_oid = pg_largeobject.loid
     WHERE demo.session_id = 'some_session_id'
     GROUP BY loid
 ) TO '/home/worker/asdf.dem' WITH BINARY;

It might be beneficial to keep them on disk.

@jayceslesar
Copy link
Contributor Author

as of now I think this is a bad idea, and that keeping these in the DB is a better bet

@megascatterbomb
Copy link
Contributor

The potential convenience of being able to back up the demos themselves by just backing up all the postgres databases is too valuable imo. Sticking with the db also prevents any large malicious payloads from just existing on the main file system waiting for execution.

@jayceslesar
Copy link
Contributor Author

jayceslesar commented May 3, 2024

Was doing a large export with @kavorite and noticed bad performance issues on exports using the current method, I believe it might be best to fallback to disk or some external storage in prod. Being able to backup is nice, but we can also back up a drive. Memory stays at the same level but CPU gets pretty tanked when querying a demo

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

No branches or pull requests

2 participants