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

Variant database rows problem #356

Open
ehsan-soleimanian opened this issue Jun 3, 2024 · 2 comments
Open

Variant database rows problem #356

ehsan-soleimanian opened this issue Jun 3, 2024 · 2 comments
Labels

Comments

@ehsan-soleimanian
Copy link

I think we should not store variant in database in order to avoiding database overflowing .
If we take a look at Wordpress database structure for image variants we see they access vairant by its name or its ratio statically and they are not stored in database.

@frasmage
Copy link
Collaborator

frasmage commented Jun 3, 2024

Those are just different designs optimizing for different things. This package aims for maximum flexibility. It records metadata about each variant as a full fledged media record. This allows either using the wordpress-like approach or always linking the original and letting the use case determine the desired variant (e.g. use the thumbnail here), as well as attaching specific variants directly to the mediable records (e.g. this article should use the sepia variant). This approach also allows for querying available variants directly from SQL, without needing to touch the file system (potentially more expensive with things like S3). Though the intervention/image integration only supports manipulating images, the variant system is designed to be able to link media of any type, e.g. a scientific study PDF linking to its summary PDF.

Though we try to be efficient, the disk limitations of your database are not a direct consideration of the package. It is up to you, the integrator of the package, to size your database AND filesystem infrastructure according to the needs of your application. The size of the files themselves is just as much of a scaling consideration (and likely much larger than a row in a database)

If you are creating so many variants that you are exceeding your available disk limits, I would recommend scaling up your infrastructure and/or sharding your database.

@ehsan-soleimanian
Copy link
Author

@frasmage
thanks for your details sean

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

No branches or pull requests

2 participants