Is there a configuration that allows attachments under say 2mb to be stored in the database but larger attachments to be stored on the filesystem?
I have a clustered configuration with mysql replication being instant I would like the smaller attachments such as images to be available in the database, however if there are larger attachments such as large reference docs (mine run upwards of 100mb sometimes) I am ok with having up to a 15 minute delay waiting for my filesystem synchronization cron job to run.
There is no such configuration but multi storage support for attachments has been added in 9.10 (meaning that what is configured in xwiki.cfg is now the default stored and not THE store anymore) so it should not be too hard to add a switch based on the attachment size too.
The current configuration based switch is located on xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiAttachment.java at master · xwiki/xwiki-platform · GitHub. Should probably moved to some utility component if it become more complex.
The alternative is to provide your own implementation of XWikiAttachmentStoreInterface which does the size based dispatch in some extension.