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

Optimize entity thumbnail storage #154

Closed
martastain opened this issue Apr 24, 2024 · 0 comments · Fixed by #364
Closed

Optimize entity thumbnail storage #154

martastain opened this issue Apr 24, 2024 · 0 comments · Fixed by #364
Assignees
Labels
type: enhancement Improvement of existing functionality or minor addition

Comments

@martastain
Copy link
Member

martastain commented Apr 24, 2024

Story

Currently, entity thumbnails are stored directly in the database as blobs without any size reduction, which results in significant growth in database size. This approach is inefficient, particularly as the volume of data increases.

Proposed Solution

Adopt a similar methodology used for handling file attachments. Specifically:

  • Implement a check during the thumbnail upload process to determine if the image size exceeds a predefined limit.
  • If the image exceeds this limit, the thumbnail should be saved to the filesystem instead of the database.
  • A scaled-down version of the thumbnail should be stored in the database to ensure quick loading and reduced space usage.

Open Questions

  • What should be the size limit for thumbnails stored in the database?
  • What scaling factor should be used for reducing the thumbnail size?

In order to maintain 100% backwards compatibility as well as consistency with project/files, scaled-down thumbnail should be accessible using ?preview=true while the original size should load thumbnail directly from the filesystem (with DB as the fallback for older projects). A migration tool could be created to process thumbnails in existing projects.

@martastain martastain self-assigned this Apr 24, 2024
@martastain martastain added MEDIUM type: enhancement Improvement of existing functionality or minor addition labels Apr 24, 2024
@mkolar mkolar removed the MEDIUM label May 6, 2024
@martastain martastain linked a pull request Sep 27, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants