I am trying to decide how to structure my image galleries for easy management by the users (users submit, organize and own their content). There are two approaches that I see along with some pros and cons:
1) One gallery is one node and images are in a multi-value ImageField inside that node.
PROS:
- Easy gallery editing, drag-and-drop reordering of images, etc. out of the box - no coding required.
- Referential integrity is enforced naturally - you delete the node and all images are deleted as part of it. No orphan images.
- Bulk uploads with Image FUpload work relatively well (see also cons)
CONS:
- The node edit page becomes less user-friendly when dealing with lots of images - the one-image-per-line interface is not good when you have 100 images for example. You need a grid for that!
- Bulk uploads with Image FUpload tends to break on large numbers of images as the post size becomes too big (upload_max_filesize and post_max_size parameters on the server are not editable on shared hosts)
- You cannot add a location (GMap + Location) to each image - you can only do that on gallery level
2) One node for the gallery and multiple single-image nodes linked to it in some of the available ways (e.g. nodereference/nodereferrer combination)
PROS:
- More freedom if you want to implement your own gallery edit page using grids, checkboxes, etc.
- Better control over display using additional fields, etc.
- You can define a location for each image
- Image FUpload has no problem with the post size as each node is submitted separately and image sizes cannot add up to exceed the post_max_size parameter
CONS:
- No easy way of enforcing cascade delete referential integrity. No module in Drupal supports that functionality. The only way to do it (without much custom coding) is through the Rules module but that just add complexity to the site and more modules means less speed.
- Bulk uploads with Image FUpload do not work quite well. The upload actually works but currently there is no way to redirect back to the main gallery node after uploading is done.
These I figured myself by trial and error (feel free to add more) but I am lost when it comes to performance ;-( Do you have any experience comparing the performance of the two methods? If you have hundreds of users, each having tens of galleries, which will be the preferred way when it comes to speed?
Comments
Comment #1
kirilius commentedAny ideas? Thanks!
Comment #2
quicksketchIn both situations you describe, I do not think performance will be a problem (Rules module aside). I've seen sites with both Images-as-Nodes and Images-as-Fields with hundreds of thousands of images. The right configuration will let you do either.
What you should be most concerned about the usability for your users and which approach provides the functionality you want. In my experience, a single node as a gallery and each image as a field frequently becomes too limiting very quickly. It gets you a small usability improvement (Drag and Drop, multiple upload) but really limits your opportunities in the future. Therefor I'd recommend an Image-as-node solution, and try to improve upon the areas where the usability is weak. I don't have many recommendations for how to fix the multi-upload, multi-delete, or custom-arrangement problems, these are things that I have not yet seen adequately fixed. But it will be much easier to add this missing functionality than it would be to make Images-as-fields support taxonomy, location, or any other custom fields.
It may not have everything you want, but I'd recommend starting with Jeff Eaton's video and try to improve upon the functionality it has. http://www.lullabot.com/articles/photo-galleries-views-attach
Comment #3
kirilius commentedThanks a lot for the commens. I have seen this video, in fact the same questions about usability and performance using both methods were asked there and I took part in the discussion as well. So for now my takeaway will be that performancewise both methords work well enough.
Comment #4
AntiNSA commentedPlease focus on getting this to work with fupload.. it works great except no redirect and error messages with og_statistics
warning: array_intersect() [function.array-intersect]: Argument #2 is not an array in /home/cyberfan/htdocs/modules/og_statistics/og_statistics.module on line 108.
warning: array_diff() [function.array-diff]: Argument #2 is not an array in /home/cyberfan/htdocs/modules/og_statistics/og_statistics.module on line 109.
warning: array_diff() [function.array-diff]: Argument #1 is not an array in /home/cyberfan/htdocs/modules/og_statistics/og_statistics.module on line 110.
Comment #5
quicksketchClosing this up, AntiNSA, your request is not related to this issue.