Don't save large binary (or base64 encoded) data into the json document. That's a poor use of the database. Instead, you should consider one of these two options:
Option 1
- Write the binary data to disk (or cloud storage) yourself.
- Save a file path (or url) to it in your document.
Option 2
- Use Raven's attachments feature. This is a separate area in the database meant specifically for storing binary files.
- The advantage is that your binary documents are included in database backups, and if you like you can take advantage of features like my Indexed Attachments Bundle, or write your own custom bundles that use attachment triggers.
- The disadvantage is that your database can grow very large. For this reason, many prefer option 1.